diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-02-11 12:05:24 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-02-11 12:05:24 +0000 |
commit | 9b1dfd3e81855c99b0ccb703d3aecc3f1a7ac7c9 (patch) | |
tree | b666372798457740d01e363deb0b090af56de7a8 | |
parent | 4eaa6a4c4df729bfad296fa69a35d9089f5bc130 (diff) | |
parent | c9371eab1304a331718dd1e3b33ebb20f44b22e3 (diff) | |
download | gitlab-ce-9b1dfd3e81855c99b0ccb703d3aecc3f1a7ac7c9.tar.gz |
Merge branch 'use-caching' into 'master'
Use caching
This enables to use built-in caching feature instead of using the `/cache` folder.
See merge request !2747
-rw-r--r-- | .gitlab-ci.yml | 46 | ||||
-rwxr-xr-x | scripts/prepare_build.sh | 12 |
2 files changed, 52 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5dfeb8a1f90..1c4d98ea3f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,11 @@ services: - postgres:latest - redis:latest +cache: + key: "ruby22" + paths: + - vendor + variables: MYSQL_ALLOW_EMPTY_PASSWORD: "1" @@ -144,6 +149,10 @@ spec:feature:ruby21: script: - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -154,6 +163,10 @@ spec:api:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -164,6 +177,10 @@ spec:models:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -174,6 +191,10 @@ spec:lib:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -184,6 +205,10 @@ spec:services:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -194,6 +219,10 @@ spec:benchmark:ruby21: - master script: - RAILS_ENV=test bundle exec rake spec:benchmark + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -205,6 +234,10 @@ spec:other:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -215,6 +248,10 @@ spinach:project:half:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -225,6 +262,10 @@ spinach:project:rest:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql @@ -235,6 +276,11 @@ spinach:other:ruby21: - master script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other + cache: + key: "ruby21" + paths: + - vendor tags: - ruby - mysql + diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index 5987988dc8e..b6f076a90c3 100755 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -1,15 +1,15 @@ #!/bin/bash if [ -f /.dockerinit ]; then - # Docker runners use `/cache` folder which is persisted every build - if [ ! -e /cache/phantomjs_1.9.8-0jessie_amd64.deb ]; then + mkdir -p vendor + if [ ! -e vendor/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 + mv phantomjs_1.9.8-0jessie_amd64.deb vendor/ fi - dpkg -i /cache/phantomjs_1.9.8-0jessie_amd64.deb + dpkg -i vendor/phantomjs_1.9.8-0jessie_amd64.deb apt-get update -qq - apt-get -o dir::cache::archives="/cache/apt" install -y -qq --force-yes \ + apt-get -o dir::cache::archives="vendor/apt" install -y -qq --force-yes \ libicu-dev libkrb5-dev cmake nodejs postgresql-client mysql-client unzip cp config/database.yml.mysql config/database.yml @@ -20,7 +20,7 @@ if [ -f /.dockerinit ]; then cp config/resque.yml.example config/resque.yml sed -i 's/localhost/redis/g' config/resque.yml - export FLAGS=(--path /cache) + export FLAGS=(--path vendor) else export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin cp config/database.yml.mysql config/database.yml |