Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 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'

question from:https://stackoverflow.com/questions/65856220/bitbucket-pipelines-not-using-cache-for-bundle-install

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

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...