Man*_*nez 10 ruby-on-rails bundler gitlab gitlab-ci
我一直在尝试利用Gitlab Ci的缓存为我的ruby on rails应用程序,但到目前为止还没有运气,我的应用程序是使用共享运行程序,也许这就是问题?
这是我的内容 .gitlab-ci.yml
services:
- postgres:latest
rspec:
stage: test
script:
- apt-get update -qy
- apt-get install -y nodejs
- gem install bundler
- bundle check --path vendor/bundle || bundle install --path vendor/bundle --jobs $(nproc)
- cp config/database.gitlab-ci.yml config/database.yml
- RAILS_ENV=test bundle exec rake db:create db:schema:load
- bundle exec rspec
cache:
paths:
- vendor/bundle
tags:
- ruby
- postgres
Run Code Online (Sandbox Code Playgroud)
当我的测试运行时,我确实看到跑步者检查缓存内容,但它从未恢复它:
gitlab-ci-multi-runner 1.1.3 (a470667)
Using Docker executor with image ruby:2.1 ...
Pulling docker image postgres:latest ...
Starting service postgres:latest ...
Waiting for services to be up and running...
Pulling docker image ruby:2.1 ...
Running on runner-8a2f473d-project-1129003-concurrent-0 via runner-8a2f473d-machine-1462982763-a9a70bd7-digital-ocean-4gb...
Cloning repository...
Cloning into '/builds/foo/bar'...
Checking out 30ea1b5f as master...
Note: checking out '30ea1b5f036808f7e27bfa32e939c1f591343ba6'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 30ea1b5... Fix width of tables contained in table-scroll divs
Checking cache for rspec/master...
$ apt-get update -qy
Run Code Online (Sandbox Code Playgroud)
当构建即将完成时,我确实看到它试图创建缓存:
Creating cache rspec/master...
vendor/bundle: found 8917 matching files
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
| 归档时间: |
|
| 查看次数: |
2507 次 |
| 最近记录: |