stages: - build_app - test_app - publish_app - build_image - publish_image variables: npm_config_registry: https://docker.ub.intern.uni-leipzig.de/npm npm_install: stage: build_app image: node:8-alpine script: - npm install - npm run build cache: key: "${CI_COMMIT_SHA}" paths: - node_modules - dist - public tags: - docker npm_ci: stage: test_app image: node:8-alpine script: - npm run ci cache: key: "${CI_COMMIT_SHA}" paths: - dist - public tags: - docker npm_pack: stage: publish_app only: - master image: node:8-alpine script: - npm pack cache: key: "${CI_COMMIT_SHA}" paths: - "*.tgz" tags: - docker docker_build: stage: build_image only: - master image: docker:latest services: - docker:dind script: - docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD} - docker build --no-cache --pull -t bdddev/dacap:latest . - docker tag bdddev/dacap:latest bdddev/dacap:${CI_PIPELINE_ID} - docker push bdddev/dacap:${CI_PIPELINE_ID} - docker push bdddev/dacap:latest cache: key: "${CI_COMMIT_SHA}" paths: - "*.tgz" tags: - docker