summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml60
1 files changed, 50 insertions, 10 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ab2d5aa5..a1ad49a0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: leapcode/ruby
+image: 0xacab.org:4567/leap-docker/ruby:latest
# This is for caching the gems not only between the stages, but also persistent
# on the gitlab-runner so we don't need to install from scratch on every pipeline
@@ -14,7 +14,7 @@ before_script:
stages:
- setup
- syntax
- - build
+ - deploy
setup:
stage: setup
@@ -24,34 +24,74 @@ setup:
lint:
stage: syntax
script:
- - /usr/local/bin/bundle exec rake lint
+ - su -c '/usr/local/bin/bundle exec rake lint' cirunner
syntax:
stage: syntax
script:
- - /usr/local/bin/bundle exec rake syntax
+ - su -c '/usr/local/bin/bundle exec rake syntax' cirunner
validate:
stage: syntax
script:
- - /usr/local/bin/bundle exec rake validate
+ - su -c '/usr/local/bin/bundle exec rake validate' cirunner
templates:
stage: syntax
script:
- - /usr/local/bin/bundle exec rake templates
+ - su -c '/usr/local/bin/bundle exec rake templates' cirunner
catalog:
stage: syntax
script:
- - /usr/local/bin/bundle exec rake catalog
+ - su -c '/usr/local/bin/bundle exec rake catalog' cirunner
#rspec:
# stage: rspec
# script:
# - /usr/local/bin/bundle exec rake spec
-build:
- stage: build
+# The deploy_test job is run on any merge request. This is used to ensure that
+# the merge request will deploy and test properly. It is not run when the merge
+# request is accepted into master, instead the 'latest' job below is run
+# instead.
+deploy_test:
+ stage: deploy
+ except:
+ - master
script:
- - /usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s
+ - su -c '/usr/bin/unbuffer bash -o pipefail ./ci-build.sh | /usr/bin/ts' cirunner
+
+# Latest job will only run on the master branch, which means all merge requests
+# that are created from branches don't get to deploy to the latest-ci server.
+# When a merge request is merged, then the latest job will deploy the code to
+# the latest provider, and the deployment will be recorded in an environment
+# named 'latest'
+ci.leap.se:
+ stage: deploy
+ environment:
+ name: staging
+ only:
+ - master
+ script:
+ - su -c '/usr/bin/unbuffer ./ci-build.sh' cirunner
+
+demo.bitmask.net:
+ stage: deploy
+ environment:
+ name: production/demo/vpn
+ only:
+ - master
+ when: manual
+ script:
+ - su -c '/usr/bin/unbuffer ./ci-build.sh' cirunner
+
+mail.bitmask.net:
+ stage: deploy
+ environment:
+ name: production/demo/mail
+ only:
+ - master
+ when: manual
+ script:
+ - su -c '/usr/bin/unbuffer ./ci-build.sh' cirunner