Commit db915f7a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'build_script' into 'master'

Add a build preparation script, modify gitlab.ci.yml to use the script.

Updated the .gitlab-ci.yml to use a script which contains build preparation for runners which might run docker images with CI runner.
Regular builds should be not affected.

See merge request !834
parents 0e615a48 0abd5653
# This file is generated by GitLab CI # This file is generated by GitLab CI
before_script: before_script:
- export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin - ./scripts/prepare_build.sh
- ruby -v - ruby -v
- which ruby - which ruby
- gem install bundler - gem install bundler --no-ri --no-rdoc
- which bundle
- echo $PATH
- cp config/database.yml.mysql config/database.yml
- cp config/gitlab.yml.example config/gitlab.yml - cp config/gitlab.yml.example config/gitlab.yml
- 'sed "s/username\:.*$/username\: runner/" -i config/database.yml'
- 'sed "s/password\:.*$/password\: ''password''/" -i config/database.yml'
- sed "s/gitlabhq_test/gitlabhq_test_$((RANDOM/5000))/" -i config/database.yml
- touch log/application.log - touch log/application.log
- touch log/test.log - touch log/test.log
- bundle install --without postgres production --jobs $(nproc) - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
- bundle exec rake db:create RAILS_ENV=test - bundle exec rake db:create RAILS_ENV=test
Rspec: Rspec:
script: script:
...@@ -48,4 +42,4 @@ Brakeman: ...@@ -48,4 +42,4 @@ Brakeman:
- bundle exec rake brakeman - bundle exec rake brakeman
tags: tags:
- ruby - ruby
- mysql - mysql
\ No newline at end of file
#!/bin/bash
if [ -f /.dockerinit ]; then
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
apt-get update -qq
apt-get install -y -qq libicu-dev libkrb5-dev cmake nodejs
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
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
FLAGS=(--deployment --path /cache)
export FLAGS
else
export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
cp config/database.yml.mysql config/database.yml
sed "s/username\:.*$/username\: runner/" -i config/database.yml
sed "s/password\:.*$/password\: 'password'/" -i config/database.yml
sed "s/gitlabhq_test/gitlabhq_test_$((RANDOM/5000))/" -i config/database.yml
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment