capistrano-bundler 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/release-drafter.yml +17 -0
- data/.github/workflows/push.yml +14 -0
- data/.gitignore +1 -0
- data/.travis.yml +9 -0
- data/CHANGELOG.md +1 -45
- data/Dangerfile +1 -0
- data/LICENSE +1 -1
- data/README.md +38 -15
- data/Rakefile +8 -0
- data/capistrano-bundler.gemspec +7 -4
- data/lib/capistrano/tasks/bundler.cap +57 -19
- metadata +21 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b2afb67a369b2e8390dc9dc5d0459717d4b6e16f7ad8d6d635e308f39a6eee1f
|
4
|
+
data.tar.gz: ab6c306e5791441f65077bd3c5b8e5404e39544c85b5f39d25d206d786ffd3c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7829207f89b9b04b6f9ef37771615c5ef1f1e6152cf0b840f9f9bc2084eebc287f90aaa6c116d3e44b3deed0fbd5d21427a7206c67a20608edb21792d3bc8f80
|
7
|
+
data.tar.gz: 23ba2692c0004a7627ed580baea167c03770c298030fb3e2bba5b14640660b65219857a10bcc84db07839958ab6367feabf6ea76559926e25131c4f0137d6665
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name-template: "$NEXT_PATCH_VERSION"
|
2
|
+
tag-template: "v$NEXT_PATCH_VERSION"
|
3
|
+
categories:
|
4
|
+
- title: "⚠️ Breaking Changes"
|
5
|
+
label: "⚠️ Breaking"
|
6
|
+
- title: "✨ New Features"
|
7
|
+
label: "✨ Feature"
|
8
|
+
- title: "🐛 Bug Fixes"
|
9
|
+
label: "🐛 Bug Fix"
|
10
|
+
- title: "📚 Documentation"
|
11
|
+
label: "📚 Docs"
|
12
|
+
- title: "🏠 Housekeeping"
|
13
|
+
label: "🏠 Housekeeping"
|
14
|
+
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
|
15
|
+
no-changes-template: "- No changes"
|
16
|
+
template: |
|
17
|
+
$CHANGES
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,45 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
* Your contribution here!
|
4
|
-
|
5
|
-
# [1.2.0][] (1 Oct 2016)
|
6
|
-
|
7
|
-
* Added a `bundle clean` task. There are no default hooks for it.
|
8
|
-
* Use `bundle check` to check if we can skip `bundle install`
|
9
|
-
* Run `bundle:install` on rollback (`deploy:reverted`)
|
10
|
-
* You can now `require "capistrano/bundler/tasks"` to load the tasks only without the hooks
|
11
|
-
|
12
|
-
# 1.1.4 (22 Jan 2015)
|
13
|
-
|
14
|
-
* Don’t generate binstubs by default (#61)
|
15
|
-
|
16
|
-
# 1.1.3 (4 Aug 2014)
|
17
|
-
|
18
|
-
* Honor `:no_release` flag by using `release_roles` in Capistrano 3.1
|
19
|
-
* capistrano-bundler now requires Capistrano 3.1 or higher (~> 3.1)
|
20
|
-
* Added `:bundle_jobs` option for specifying number of parallel jobs
|
21
|
-
|
22
|
-
# 1.1.2 (8 Feb 2014)
|
23
|
-
|
24
|
-
* Added `bundle_env_variables` option for specifying environment variables that should be set when running `bundle`.
|
25
|
-
* The `bundle_dir` option is now named `bundle_path`
|
26
|
-
* Use `bundle install` instead of `bundle`
|
27
|
-
* All options are now optional and can be excluded from the final bundle command by setting them to `nil`
|
28
|
-
* Bundler looks for a `Gemfile` by default, so there is no need to specify it.
|
29
|
-
|
30
|
-
# 1.1.1
|
31
|
-
|
32
|
-
* ruby is not prefixed with `bundle exec` anymore by default
|
33
|
-
* prefix rails with `bundle exec` by default
|
34
|
-
|
35
|
-
# 1.1.0
|
36
|
-
|
37
|
-
* Switching to new command map (https://github.com/capistrano/sshkit/pull/45)
|
38
|
-
Thanks to new command map, now this integration adds `bundle exec` to global executables (gem, ruby, rake). The list of executable can be tweaked by `bundle_bins`.
|
39
|
-
|
40
|
-
# 1.0.0
|
41
|
-
|
42
|
-
Initial release
|
43
|
-
|
44
|
-
[Unreleased]: https://github.com/capistrano/bundler/compare/v1.2.0...HEAD
|
45
|
-
[1.2.0]: https://github.com/capistrano/bundler/compare/v1.1.4...v1.2.0
|
1
|
+
Release notes for this project are kept here: https://github.com/capistrano/bundler/releases
|
data/Dangerfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
danger.import_dangerfile(github: "capistrano/danger", branch: "no-changelog")
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2020 Capistrano, your one stop deployment shop.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.md
CHANGED
@@ -10,11 +10,11 @@ It also prefixes certain binaries to use `bundle exec`.
|
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
13
|
-
Add these lines to your application's Gemfile
|
13
|
+
Add these lines to your application's Gemfile **[Recommended]**:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'capistrano', '~> 3.
|
17
|
-
gem 'capistrano-bundler', '~>
|
16
|
+
gem 'capistrano', '~> 3.6'
|
17
|
+
gem 'capistrano-bundler', '~> 2.0'
|
18
18
|
```
|
19
19
|
|
20
20
|
And then execute:
|
@@ -37,11 +37,33 @@ Require in `Capfile` to use the default task:
|
|
37
37
|
require 'capistrano/bundler'
|
38
38
|
```
|
39
39
|
|
40
|
-
The task will run before `deploy:updated` as part of Capistrano's default deploy, or can be run in isolation with `cap production bundler:install
|
40
|
+
The task will run before `deploy:updated` as part of Capistrano's default deploy, or can be run in isolation with `cap production bundler:install`.
|
41
|
+
|
42
|
+
In order for Bundler to work efficiently on the server, its project configuration directory (`<release_path>/.bundle/`) should be persistent across releases.
|
43
|
+
You need to add it to the `linked_dirs` Capistrano variable:
|
44
|
+
|
45
|
+
Capistrano **3.5**+:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
# config/deploy.rb
|
49
|
+
|
50
|
+
append :linked_dirs, '.bundle'
|
51
|
+
```
|
52
|
+
|
53
|
+
Capistrano < 3.5:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# config/deploy.rb
|
57
|
+
|
58
|
+
set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'
|
59
|
+
```
|
60
|
+
|
61
|
+
It will still work fine with non-persistent configuration directory, but then it will have to re-resolve all gems on each deploy.
|
41
62
|
|
42
63
|
By default, the plugin adds `bundle exec` prefix to common executables listed in `bundle_bins` option. This currently applies for `gem`, `rake` and `rails`.
|
43
64
|
|
44
65
|
You can add any custom executable to this list:
|
66
|
+
|
45
67
|
```ruby
|
46
68
|
set :bundle_bins, fetch(:bundle_bins, []).push('my_new_binary')
|
47
69
|
```
|
@@ -50,21 +72,23 @@ Configurable options:
|
|
50
72
|
|
51
73
|
```ruby
|
52
74
|
set :bundle_roles, :all # this is default
|
75
|
+
set :bundle_config, { deployment: true } # this is default
|
53
76
|
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
|
54
77
|
set :bundle_binstubs, -> { shared_path.join('bin') } # default: nil
|
55
78
|
set :bundle_gemfile, -> { release_path.join('MyGemfile') } # default: nil
|
56
|
-
set :bundle_path, -> { shared_path.join('bundle') } # this is default. set it to nil
|
79
|
+
set :bundle_path, -> { shared_path.join('bundle') } # this is default. set it to nil to use bundler's default path
|
57
80
|
set :bundle_without, %w{development test}.join(' ') # this is default
|
58
|
-
set :bundle_flags, '--
|
81
|
+
set :bundle_flags, '--quiet' # this is default
|
59
82
|
set :bundle_env_variables, {} # this is default
|
60
83
|
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
|
84
|
+
set :bundle_check_before_install, true # default: true. Set this to false to bypass running `bundle check` before executing `bundle install`
|
61
85
|
```
|
62
86
|
|
63
87
|
You can parallelize the installation of gems with bundler's jobs feature.
|
64
88
|
Choose a number less or equal than the number of cores your server.
|
65
89
|
|
66
90
|
```ruby
|
67
|
-
set :bundle_jobs,
|
91
|
+
set :bundle_jobs, 8 # default: 4, only available for Bundler >= 1.4
|
68
92
|
```
|
69
93
|
|
70
94
|
To generate binstubs on each deploy, set `:bundle_binstubs` path:
|
@@ -73,19 +97,18 @@ To generate binstubs on each deploy, set `:bundle_binstubs` path:
|
|
73
97
|
set :bundle_binstubs, -> { shared_path.join('bin') }
|
74
98
|
```
|
75
99
|
|
76
|
-
In the result this would execute the following bundle
|
100
|
+
In the result this would execute the following bundle commands on all servers
|
77
101
|
(actual paths depend on the real deploy directory):
|
78
102
|
|
79
103
|
```sh
|
80
|
-
$ bundle
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
--deployment --quiet
|
104
|
+
$ bundle config --local deployment true
|
105
|
+
$ bundle config --local gemfile /my_app/releases/20130623094732/MyGemfile
|
106
|
+
$ bundle config --local path /my_app/shared/bundle
|
107
|
+
$ bundle config --local without "development test"
|
108
|
+
$ bundle install --quiet --binstubs /my_app/shared/bin
|
86
109
|
```
|
87
110
|
|
88
|
-
If any option is set to `nil` it will be excluded from the final bundle
|
111
|
+
If any option is set to `nil` it will be excluded from the final bundle commands.
|
89
112
|
|
90
113
|
If you want to clean up gems after a successful deploy, add `after 'deploy:published', 'bundler:clean'` to config/deploy.rb.
|
91
114
|
|
data/Rakefile
CHANGED
data/capistrano-bundler.gemspec
CHANGED
@@ -4,13 +4,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'capistrano-bundler'
|
7
|
-
spec.version = '
|
7
|
+
spec.version = '2.0.0'
|
8
|
+
spec.license = 'MIT'
|
8
9
|
spec.authors = ['Tom Clements', 'Lee Hambley', 'Kir Shatrov']
|
9
10
|
spec.email = ['seenmyfate@gmail.com', 'lee.hambley@gmail.com', 'shatrov@me.com']
|
10
11
|
spec.description = %q{Bundler support for Capistrano 3.x}
|
11
12
|
spec.summary = %q{Bundler support for Capistrano 3.x}
|
12
13
|
spec.homepage = 'https://github.com/capistrano/bundler'
|
13
|
-
spec.
|
14
|
+
spec.metadata = {
|
15
|
+
"changelog_uri" => "https://github.com/capistrano/bundler/releases"
|
16
|
+
}
|
14
17
|
|
15
18
|
spec.files = `git ls-files`.split($/)
|
16
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -18,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
18
21
|
spec.require_paths = ['lib']
|
19
22
|
|
20
23
|
spec.add_dependency 'capistrano', '~> 3.1'
|
21
|
-
spec.add_dependency 'sshkit', '~> 1.2'
|
22
24
|
|
23
|
-
spec.add_development_dependency 'bundler', '~> 1
|
25
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
26
|
+
spec.add_development_dependency 'danger'
|
24
27
|
spec.add_development_dependency 'rake'
|
25
28
|
end
|
@@ -1,9 +1,39 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
namespace :bundler do
|
2
4
|
desc <<-DESC
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
Configure the Bundler environment for the release so that subequent
|
6
|
+
`bundle check`, `bundle install`, `bundle clean`, and `bundle exec`
|
7
|
+
commands all behave consistently. The following settings will be
|
8
|
+
turned into the appropriate `bundle config` executions:
|
9
|
+
|
10
|
+
:bundle_config
|
11
|
+
:bundle_gemfile
|
12
|
+
:bundle_path
|
13
|
+
:bundle_without
|
14
|
+
DESC
|
15
|
+
task :config do
|
16
|
+
on fetch(:bundle_servers) do
|
17
|
+
within release_path do
|
18
|
+
with fetch(:bundle_env_variables) do
|
19
|
+
configuration = fetch(:bundle_config).dup || {}
|
20
|
+
configuration[:gemfile] = fetch(:bundle_gemfile)
|
21
|
+
configuration[:path] = fetch(:bundle_path)
|
22
|
+
configuration[:without] = fetch(:bundle_without)
|
23
|
+
|
24
|
+
configuration.each do |key, value|
|
25
|
+
execute :bundle, "config", "--local", key, value.to_s.shellescape unless value.nil?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
desc <<-DESC
|
33
|
+
Install the current Bundler environment. By default, gems will be
|
34
|
+
installed to the shared/bundle path. Gems in the development and
|
35
|
+
test group will not be installed. The install command is executed
|
36
|
+
with the --quiet and --jobs=4 flags.
|
7
37
|
|
8
38
|
By default, bundler will not be run on servers with no_release: true.
|
9
39
|
|
@@ -11,27 +41,27 @@ namespace :bundler do
|
|
11
41
|
|
12
42
|
set :bundle_roles, :all
|
13
43
|
|
44
|
+
set :bundle_config, { deployment: true }
|
14
45
|
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) }
|
15
|
-
set :bundle_binstubs,
|
46
|
+
set :bundle_binstubs, nil
|
16
47
|
set :bundle_gemfile, -> { release_path.join('Gemfile') }
|
17
48
|
set :bundle_path, -> { shared_path.join('bundle') }
|
18
49
|
set :bundle_without, %w{development test}.join(' ')
|
19
|
-
set :bundle_flags, '--
|
20
|
-
set :bundle_jobs,
|
50
|
+
set :bundle_flags, '--quiet'
|
51
|
+
set :bundle_jobs, 4
|
21
52
|
set :bundle_env_variables, {}
|
22
53
|
set :bundle_clean_options, ""
|
23
54
|
DESC
|
24
|
-
task :
|
55
|
+
task install: :config do
|
25
56
|
on fetch(:bundle_servers) do
|
26
57
|
within release_path do
|
27
|
-
with fetch(:bundle_env_variables
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
58
|
+
with fetch(:bundle_env_variables) do
|
59
|
+
if fetch(:bundle_check_before_install) && test(:bundle, :check)
|
60
|
+
info "The Gemfile's dependencies are satisfied, skipping installation"
|
61
|
+
else
|
62
|
+
options = []
|
32
63
|
options << "--binstubs #{fetch(:bundle_binstubs)}" if fetch(:bundle_binstubs)
|
33
64
|
options << "--jobs #{fetch(:bundle_jobs)}" if fetch(:bundle_jobs)
|
34
|
-
options << "--without #{fetch(:bundle_without)}" if fetch(:bundle_without)
|
35
65
|
options << "#{fetch(:bundle_flags)}" if fetch(:bundle_flags)
|
36
66
|
execute :bundle, :install, *options
|
37
67
|
end
|
@@ -52,12 +82,12 @@ namespace :bundler do
|
|
52
82
|
end
|
53
83
|
end
|
54
84
|
|
55
|
-
desc "Remove unused gems
|
56
|
-
task :
|
85
|
+
desc "Remove unused gems installed by bundler"
|
86
|
+
task clean: :config do
|
57
87
|
on fetch(:bundle_servers) do
|
58
88
|
within release_path do
|
59
|
-
with fetch(:bundle_env_variables
|
60
|
-
execute :bundle, :clean, fetch(:bundle_clean_options
|
89
|
+
with fetch(:bundle_env_variables) do
|
90
|
+
execute :bundle, :clean, fetch(:bundle_clean_options)
|
61
91
|
end
|
62
92
|
end
|
63
93
|
end
|
@@ -73,9 +103,17 @@ namespace :load do
|
|
73
103
|
set :bundle_bins, %w{gem rake rails}
|
74
104
|
|
75
105
|
set :bundle_roles, :all
|
106
|
+
|
107
|
+
set :bundle_config, { deployment: true }
|
76
108
|
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) }
|
109
|
+
set :bundle_binstubs, nil
|
110
|
+
set :bundle_gemfile, nil
|
77
111
|
set :bundle_path, -> { shared_path.join('bundle') }
|
78
112
|
set :bundle_without, %w{development test}.join(' ')
|
79
|
-
set :bundle_flags, '--
|
113
|
+
set :bundle_flags, '--quiet'
|
114
|
+
set :bundle_jobs, 4
|
115
|
+
set :bundle_env_variables, {}
|
116
|
+
set :bundle_clean_options, ""
|
117
|
+
set :bundle_check_before_install, true
|
80
118
|
end
|
81
119
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
8
8
|
- Lee Hambley
|
9
9
|
- Kir Shatrov
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capistrano
|
@@ -27,33 +27,33 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '3.1'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
30
|
+
name: bundler
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '1
|
36
|
-
type: :
|
35
|
+
version: '2.1'
|
36
|
+
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1
|
42
|
+
version: '2.1'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
44
|
+
name: danger
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rake
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,8 +77,12 @@ executables: []
|
|
77
77
|
extensions: []
|
78
78
|
extra_rdoc_files: []
|
79
79
|
files:
|
80
|
+
- ".github/release-drafter.yml"
|
81
|
+
- ".github/workflows/push.yml"
|
80
82
|
- ".gitignore"
|
83
|
+
- ".travis.yml"
|
81
84
|
- CHANGELOG.md
|
85
|
+
- Dangerfile
|
82
86
|
- Gemfile
|
83
87
|
- LICENSE
|
84
88
|
- README.md
|
@@ -93,8 +97,9 @@ files:
|
|
93
97
|
homepage: https://github.com/capistrano/bundler
|
94
98
|
licenses:
|
95
99
|
- MIT
|
96
|
-
metadata:
|
97
|
-
|
100
|
+
metadata:
|
101
|
+
changelog_uri: https://github.com/capistrano/bundler/releases
|
102
|
+
post_install_message:
|
98
103
|
rdoc_options: []
|
99
104
|
require_paths:
|
100
105
|
- lib
|
@@ -109,9 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
114
|
- !ruby/object:Gem::Version
|
110
115
|
version: '0'
|
111
116
|
requirements: []
|
112
|
-
|
113
|
-
|
114
|
-
signing_key:
|
117
|
+
rubygems_version: 3.1.4
|
118
|
+
signing_key:
|
115
119
|
specification_version: 4
|
116
120
|
summary: Bundler support for Capistrano 3.x
|
117
121
|
test_files: []
|