2

我在我的 Ruby on Rails 项目中使用 Wercker。我的 wercker.yml 看起来像这样:

box: ruby
services:
  - postgres
build:
    steps:
        - script:
            name: Nokogiri fix
            code: bundle config build.nokogiri --use-system-libraries
        - bundle-install
        - rails-database-yml
        - script:
            name: Set up db
            code: bundle exec rake db:schema:load RAILS_ENV=test
        - script:
            name: rspec
            code: bundle exec rspec
    after-steps:
        - slack-notifier:
            url: $SLACK_URL
            channel: notifications
            username: werckerbot

问题是 wercker 每次都使用 bundle install 下载 gem 而不是从缓存中获取它们。有了这个,我的构建需要将近 2 分钟而不是几秒钟......我该如何解决这个问题?

4

0 回答 0