Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

ruby - Bitbucket pipelines not using cache for bundle install

I have tried every variation of naming my cache and nothing seems to work

My cache is being downloaded properly as I can see in the build setup.

Cache "bundler": Downloading
Cache "bundler": Downloaded 25.2 MiB in 1 seconds
Cache "bundler": Extracting
Cache "bundler": Extracted in 0 seconds

however when I go to bundle install I always get

Fetching gem metadata from https://rubygems.org/.......
Installing rake 12.3.3
Installing concurrent-ruby 1.1.5
Installing i18n 0.9.5
Installing minitest 5.11.3
Installing thread_safe 0.3.6
Installing tzinfo 1.2.5
Installing activesupport 5.2.3
Installing builder 3.2.3
..........

Here is my bitbucket-pipelines.yml

pipelines:
  default:
    - step:
        name: Run Tests
        image: ruby:2.6.4
        caches:
          - bundler
        script:
          - apt-get update && apt-get install -y build-essential libpq-dev nodejs python-dev
          - bundle install --path ./vendor
          - cp config/database.yml.example config/database.yml
          - RAILS_ENV=test bundle exec rake db:setup
          - RAILS_ENV=test bundle exec rake db:schema:load
          - RAILS_ENV=test bundle exec rspec
        services:
          - postgres
          - redis

definitions:
  caches:
    bundler: ./vendor
  services:
    redis:
      image: redis
    postgres:
      image: postgres
      environment:
        POSTGRES_DB: 'xxxxx'
        POSTGRES_USER: 'xxxxx'
        POSTGRES_PASSWORD: 'xxxxx'


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...