diff options
author | Daniel Gerhardt <code@dgerhardt.net> | 2015-07-25 15:17:38 +0200 |
---|---|---|
committer | Daniel Gerhardt <code@dgerhardt.net> | 2015-07-25 17:52:11 +0200 |
commit | 3a9992ed5cafc85b30d63a7583729f15191be0d9 (patch) | |
tree | 82bf9dfbfd71efb831c00c5976d7b907b5f7a57d | |
parent | d5214bb6ff38ab31817ad5cb6e3436e52c4792a7 (diff) | |
download | gitlab-ci-3a9992ed5cafc85b30d63a7583729f15191be0d9.tar.gz |
Adjust CI config to support Docker executors
A shell script (based on the one for GitLab CE) has been added to
support Docker executors. Tags have been added to make sure builds are
only executed on appropriate runners.
-rw-r--r-- | .gitlab-ci.yml | 16 | ||||
-rwxr-xr-x | script/prepare_build.sh | 21 |
2 files changed, 32 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b7d749..69f7289 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,23 @@ before_script: - - export PATH=~/bin:/usr/local/bin:/usr/bin:/bin + - ./script/prepare_build.sh - ruby -v - gem install bundler - - cp config/database.yml.mysql config/database.yml - cp config/application.yml.example config/application.yml - cp config/secrets.yml.example config/secrets.yml - - 'sed "s/username\:.*$/username\: runner/" -i config/database.yml' - - 'sed "s/password\:.*$/password\: ''password''/" -i config/database.yml' - bundle --without postgres - RAILS_ENV=test bundle exec rake db:setup specs: script: SIMPLECOV=true RAILS_ENV=test bundle exec rake spec + tags: + - ruby + - mysql rubocop: script: bundle exec rubocop + tags: + - ruby + - mysql brakeman: - script: bundle exec brakeman
\ No newline at end of file + script: bundle exec brakeman + tags: + - ruby + - mysql diff --git a/script/prepare_build.sh b/script/prepare_build.sh new file mode 100755 index 0000000..836e11f --- /dev/null +++ b/script/prepare_build.sh @@ -0,0 +1,21 @@ +#!/bin/bash +if [ -f /.dockerinit ]; then + export FLAGS=(--deployment --path /cache) + + apt-get update -qq + apt-get install -y -qq nodejs + + wget -q http://ftp.de.debian.org/debian/pool/main/p/phantomjs/phantomjs_1.9.0-1+b1_amd64.deb + dpkg -i phantomjs_1.9.0-1+b1_amd64.deb + + cp config/database.yml.mysql config/database.yml + sed -i "s/username:.*/username: root/g" config/database.yml + sed -i "s/password:.*/password:/g" config/database.yml + sed -i "s/# socket:.*/host: mysql/g" config/database.yml +else + export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin + + cp config/database.yml.mysql config/database.yml + sed -i "s/username\:.*$/username\: runner/" config/database.yml + sed -i "s/password\:.*$/password\: 'password'/" config/database.yml +fi |