.gitlab-ci.yml 1.21 KB
Newer Older
1
image: node:6.12.2
2

3 4 5 6 7 8 9
services:
    - postgres:latest

variables:
    POSTGRES_DB: 'blendb_fixture'
    POSTGRES_USER: 'runner'
    POSTGRES_PASSWORD: ''
10
    PKG_VERSION: 'latest'
11

12 13
cache:
    paths:
14
        - node_modules
15

16 17 18 19 20
stages:
    - test
    - build
    - deploy

21 22

run_tests:
23 24 25
    stage: test
    before_script:
        - npm install --silent
26
    script:
27
        - mv config/ci_test.yaml.example config/test.yaml
28
        - mv config/ci_test.env.example config/test.env
29
        - npm test
30
        - npm run lint
31 32
    tags:
        - node
33
        - postgres
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
build:
    stage: build
    variables:
        PKG_VERSION: 'latest'
    script:
        - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ')
        - echo ${PKG_VERSION}
        - docker build -t marula.c3sl.ufpr.br:5000/c3sl/blendb:${PKG_VERSION} .
    tags:
        - docker
        - build

deploy:
    stage: deploy
    variables:
        PKG_VERSION: 'latest'
    script:
        - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ')
        - docker push marula.c3sl.ufpr.br:5000/c3sl/blendb:${PKG_VERSION} .
    tags:
        - docker
        - build
    only:
        - master