summaryrefslogtreecommitdiff
path: root/scripts/prepare_build.sh
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-01-22 18:16:59 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-01-22 19:09:22 +0100
commitedf93ecb6eab702de1a2ec24d58d1ad1dd1d9e55 (patch)
tree1315fc276db4977044db46c952ab793f5a951355 /scripts/prepare_build.sh
parent0e51ca7c4841bb388c0decb57ecc64af86c77805 (diff)
downloadgitlab-ce-edf93ecb6eab702de1a2ec24d58d1ad1dd1d9e55.tar.gz
Speed-up docker based buildsspeed-up-builds
Enable to: - Use APT cache - Use Bundler cache - Use PhantomJS cache
Diffstat (limited to 'scripts/prepare_build.sh')
-rwxr-xr-xscripts/prepare_build.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index 119cc90fc1e..fb648d27621 100755
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -1,10 +1,16 @@
#!/bin/bash
+
if [ -f /.dockerinit ]; then
- wget -q https://gitlab.com/axil/phantomjs-debian/raw/master/phantomjs_1.9.8-0jessie_amd64.deb
- dpkg -i phantomjs_1.9.8-0jessie_amd64.deb
+ # Docker runners use `/cache` folder which is persisted every build
+ if [ ! -e /cache/phantomjs_1.9.8-0jessie_amd64.deb ]; then
+ wget -q https://gitlab.com/axil/phantomjs-debian/raw/master/phantomjs_1.9.8-0jessie_amd64.deb
+ mv phantomjs_1.9.8-0jessie_amd64.deb /cache
+ fi
+ dpkg -i /cache/phantomjs_1.9.8-0jessie_amd64.deb
apt-get update -qq
- apt-get install -y -qq libicu-dev libkrb5-dev cmake nodejs postgresql-client mysql-client
+ apt-get -o dir::cache::archives="/cache/apt" install -y -qq \
+ libicu-dev libkrb5-dev cmake nodejs postgresql-client mysql-client
cp config/database.yml.mysql config/database.yml
sed -i 's/username:.*/username: root/g' config/database.yml
@@ -13,8 +19,8 @@ if [ -f /.dockerinit ]; then
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
- FLAGS=(--deployment --path /cache)
- export FLAGS
+
+ export FLAGS=(--path /cache)
else
export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
cp config/database.yml.mysql config/database.yml