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

3 4
services:
    - postgres:latest
5 6 7
    - 
        name: "dockerregistry.c3sl.ufpr.br:5000/c3sl/monetdb-ci-service:latest"
        alias: "monet"
8 9 10 11 12

variables:
    POSTGRES_DB: 'blendb_fixture'
    POSTGRES_USER: 'runner'
    POSTGRES_PASSWORD: ''
13
    MONETDB_NAME: 'blendb_fixture'
14
    PKG_VERSION: 'latest'
15
    DOCKER_URL: 'dockerregistry.c3sl.ufpr.br:5000/c3sl/blendb:'
16

17 18
cache:
    paths:
19
        - node_modules
20

21 22 23 24 25
stages:
    - test
    - build
    - deploy

26

27
run_test_postgres:
28
    stage: test
29
    script:                
30
        - yarn install --frozen-lockfile --silent --non-interactive
31
        - mv config/ci_postgres_test.env.example config/test.env
32 33
        - yarn test
        - yarn run lint
34 35
    tags:
        - node
36
        - postgres
37 38 39 40 41 42 43 44 45 46 47

run_test_monet:
    stage: test
    script: 
        - yarn install --frozen-lockfile --silent --non-interactive
        - mv config/ci_monet_test.env.example config/test.env
        - yarn test
        - yarn run lint
    tags:
        - node

48 49 50
build:
    stage: build
    variables:
51
        PKG_VERSION: ''
52 53 54
    script:
        - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ')
        - echo ${PKG_VERSION}
55
        - docker build -t ${DOCKER_URL}${PKG_VERSION} -t ${DOCKER_URL}latest .
56 57 58 59 60 61 62
    tags:
        - docker
        - build

deploy:
    stage: deploy
    variables:
63
        PKG_VERSION: ''
64 65
    script:
        - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ')
66 67
        - docker push ${DOCKER_URL}${PKG_VERSION}
        - docker push ${DOCKER_URL}latest
68 69 70 71 72 73
    tags:
        - docker
        - build
    only:
        - master