Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setting to determine if test should be ran for full installation #107

Merged
merged 5 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Unreleased][] (master)

* Your contribution here!
* Added `bundle_check_before_install` option to allow bypassing the `bundle install test` in the `bundler:install` task.

# [1.5.0][] (23 Dec 2018)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set :bundle_without, %w{development test}.join(' ') # this is defaul
set :bundle_flags, '--deployment --quiet' # this is default
set :bundle_env_variables, {} # this is default
set :bundle_clean_options, "" # this is default. Use "--dry-run" if you just want to know what gems would be deleted, without actually deleting them
set :bundle_check_before_install, true # default: true. Set this to false to bypass running `bundle check` before executing `bundle install`
```

You can parallelize the installation of gems with bundler's jobs feature.
Expand Down
4 changes: 3 additions & 1 deletion lib/capistrano/tasks/bundler.cap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ namespace :bundler do
options = []
options << "--gemfile #{fetch(:bundle_gemfile)}" if fetch(:bundle_gemfile)
options << "--path #{fetch(:bundle_path)}" if fetch(:bundle_path)
if test(:bundle, :check, *options)

if fetch(:bundle_check_before_install) && test(:bundle, :check, *options)
info "The Gemfile's dependencies are satisfied, skipping installation"
else
options << "--binstubs #{fetch(:bundle_binstubs)}" if fetch(:bundle_binstubs)
Expand Down Expand Up @@ -84,5 +85,6 @@ namespace :load do
set :bundle_jobs, 4
set :bundle_env_variables, {}
set :bundle_clean_options, ""
set :bundle_check_before_install, true
end
end