image: node:6.12.2 services: - postgres:latest variables: POSTGRES_DB: 'blendb_fixture' POSTGRES_USER: 'runner' POSTGRES_PASSWORD: '' PKG_VERSION: 'latest' DOCKER_URL: 'marula.c3sl.ufpr.br:5000/c3sl/blendb:' cache: paths: - node_modules stages: - test - build - deploy run_tests: stage: test before_script: - yarn install --frozen-lockfile --silent --non-interactive script: - mv config/ci_test.yaml.example config/test.yaml - mv config/ci_test.env.example config/test.env - yarn test - yarn run lint tags: - node - postgres build: stage: build variables: PKG_VERSION: '' script: - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ') - echo ${PKG_VERSION} - docker build -t ${DOCKER_URL}${PKG_VERSION} -t ${DOCKER_URL}latest . tags: - docker - build deploy: stage: deploy variables: PKG_VERSION: '' script: - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ') - docker push ${DOCKER_URL}${PKG_VERSION} - docker push ${DOCKER_URL}latest tags: - docker - build only: - master