Skip to content
Snippets Groups Projects
Commit bcab2430 authored by Kamil Trzciński's avatar Kamil Trzciński
Browse files

Merge branch 'ci-config-docker-support' into 'master'

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.

This makes it possible to test forks of the GitLab CI repository on
public runners. Previously, builds failed with the following error:

```
$ bundle --without postgres
/builds/eldamir/gitlab-ci.sh: line 29: bundle: command not found

ERROR: Build failed with: exit code 127
```

See merge request !212
parents 27fc082d 3a9992ed
No related branches found
No related tags found
No related merge requests found
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
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment