stages: - tests - publish - deploy image: mykiwi/docker services: - docker:dind variables: DOCKER_DRIVER: overlay2 tests: stage: tests coverage: '/^\s*Lines:\s*\d+.\d+\%/' cache: paths: - node_modules/ script: - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com - cp -f .env.dist .env - docker run --rm --volume $(pwd):/app -w="/app" registry.gitlab.com/easyblue/tools/docker-images/node:alpine yarn install - docker run --rm --volume $(pwd):/app -w="/app" registry.gitlab.com/easyblue/tools/docker-images/node:alpine yarn lint - docker run --rm --volume $(pwd):/app -w="/app" registry.gitlab.com/easyblue/tools/docker-images/node:alpine yarn build deploy_preproduction: stage: deploy when: manual image: ruby:2.3 script: - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - ssh-add <(echo -e "$SSH_PRIVATE_KEY") - gem install bundler - bundle install - bundle exec cap preproduction deploy environment: name: preproduction url: https://www.preproduction.easyblue.io only: - develop revert_preproduction: stage: deploy when: manual image: ruby:2.3 script: - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - ssh-add <(echo -e "$SSH_PRIVATE_KEY") - gem install bundler - bundle install - bundle exec cap preproduction deploy:rollback environment: name: preproduction url: https://www.preproduction.easyblue.io only: - develop deploy_production: stage: deploy when: manual image: ruby:2.3 script: - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - ssh-add <(echo -e "$SSH_PRIVATE_KEY") - gem install bundler - bundle install - bundle exec cap production deploy environment: name: production url: https://www.easyblue.io only: - master revert_production: stage: deploy when: manual image: ruby:2.3 script: - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - ssh-add <(echo -e "$SSH_PRIVATE_KEY") - gem install bundler - bundle install - bundle exec cap production deploy:rollback environment: name: production url: https://www.easyblue.io only: - master