summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2017-04-20 14:35:03 -0400
committerMicah Anderson <micah@riseup.net>2017-04-20 14:43:50 -0400
commit92f069fc456260c0cc394ab280e61a560ccb3345 (patch)
tree0185212e3dd13ad5bd12d06910d31200bfdd2daf /.gitlab-ci.yml
parentb6d23b4051587cd4dd69259ef7ead680fc66ce95 (diff)
Enhance ci-build.sh for latest CI builds.
. Reorganize script to allow for multiple builds . Add latest build, pulling from the ibex provider . Run the build as the cirunner unprivileged user . Set pipefail because job is run within a pipe . Change name of 'build' stage to 'deploy' . Setup an environment for the latest CI deployment
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml32
1 files changed, 23 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ab2d5aa5..8d3afaa5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: leapcode/ruby
+image: 0xacab.org:4567/leap/gitlab-buildpackage:ruby
# 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,27 +24,27 @@ 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
@@ -52,6 +52,20 @@ catalog:
# - /usr/local/bin/bundle exec rake spec
build:
- stage: build
+ stage: deploy
script:
- - /usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s
+ - su -c '/usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s' 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'
+latest:
+ stage: deploy
+ environment:
+ name: latest
+ only:
+ - master
+ script:
+ - su -c '/usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s' cirunner