capistrano-bundler 1.3.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9b1c1916ab0e176f784186ee7ea028c18b0559c1
4
- data.tar.gz: ecbe8ef7523ca08be476d843f15e49ca87521265
2
+ SHA256:
3
+ metadata.gz: 8053398d08ff32053d03773eee9c1e5d1a3984e681fc4e88b9154b3d51ede801
4
+ data.tar.gz: 8bf98c42d9eed292d72d3a0993122b0d4c3b7ff4fa5ae0c2099d47c23ce9f05c
5
5
  SHA512:
6
- metadata.gz: 77a72d5a04ae297c6e9197c0e5b9bd12eb36df53b378d7c30260e9c237df941a0665518125af959697591f71d6e05eaecd22bff3f03d72e5e3be2795ab065d02
7
- data.tar.gz: 05d8115080a4bc9280d67995ef6a7e64bfbea7be550988c8e340ec80907a687d758843bf18edb6c579f77886d66b77a7eaccdf4490a24fb2581c5dc2d7f22f77
6
+ metadata.gz: c980a9df70ef8f627147349540992413c6fe47a1744d17f802a5d2b278be573e9be9073de698f17854307a34dffcfd21b51d2cd355cfe324e003c8c37d0f525f
7
+ data.tar.gz: f37e5b38046f9b89e6d8fd17d786190563b2ffa98162cbb3d83caccd42c0ab87034307bfca8dc538c5c81d2c1b23f1b22bf9d9b1622f79701de703ad30a90caa
@@ -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
@@ -0,0 +1,14 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ update_release_draft:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: release-drafter/release-drafter@v5
13
+ env:
14
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,6 +1,9 @@
1
- sudo: false
1
+ ---
2
2
  language: ruby
3
+ cache: bundler
4
+ branches:
5
+ only:
6
+ - master
3
7
  rvm:
4
- - 2.3.3
5
- before_install: gem install bundler -v '~> 1.14' --conservative
6
- before_script: bundle exec danger
8
+ - 2.7.1
9
+ script: bundle exec danger
@@ -1,62 +1 @@
1
- # [Unreleased][] (master)
2
-
3
- * Your contribution here!
4
-
5
- # [1.3.0][] (22 Sep 2017)
6
-
7
- Breaking changes
8
-
9
- * None
10
-
11
- Added
12
-
13
- * Set all variables in `load:defaults` task so they are recognised as valid Capistrano settings when using `doctor:variables` and ensure defaults for `bundle_env_variables` and `bundle_clean_options` are set once in the same place as the other defaults.
14
-
15
- # [1.2.0][] (1 Oct 2016)
16
-
17
- Breaking changes
18
-
19
- * None
20
-
21
- Added
22
-
23
- * A `bundle clean` task. There are no default hooks for it.
24
- * Use `bundle check` to check if we can skip `bundle install`
25
- * Run `bundle:install` on rollback (`deploy:reverted`)
26
- * You can now `require "capistrano/bundler/tasks"` to load the tasks only without the hooks
27
-
28
- # 1.1.4 (22 Jan 2015)
29
-
30
- * Don’t generate binstubs by default (#61)
31
-
32
- # 1.1.3 (4 Aug 2014)
33
-
34
- * Honor `:no_release` flag by using `release_roles` in Capistrano 3.1
35
- * capistrano-bundler now requires Capistrano 3.1 or higher (~> 3.1)
36
- * Added `:bundle_jobs` option for specifying number of parallel jobs
37
-
38
- # 1.1.2 (8 Feb 2014)
39
-
40
- * Added `bundle_env_variables` option for specifying environment variables that should be set when running `bundle`.
41
- * The `bundle_dir` option is now named `bundle_path`
42
- * Use `bundle install` instead of `bundle`
43
- * All options are now optional and can be excluded from the final bundle command by setting them to `nil`
44
- * Bundler looks for a `Gemfile` by default, so there is no need to specify it.
45
-
46
- # 1.1.1
47
-
48
- * ruby is not prefixed with `bundle exec` anymore by default
49
- * prefix rails with `bundle exec` by default
50
-
51
- # 1.1.0
52
-
53
- * Switching to new command map (https://github.com/capistrano/sshkit/pull/45)
54
- 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`.
55
-
56
- # 1.0.0
57
-
58
- Initial release
59
-
60
- [Unreleased]: https://github.com/capistrano/bundler/compare/v1.3.0...HEAD
61
- [1.3.0]: https://github.com/capistrano/bundler/compare/v1.2.0...v1.3.0
62
- [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 CHANGED
@@ -1 +1 @@
1
- danger.import_dangerfile(github: "capistrano/danger")
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) 2016 Capistrano, your one stop deployment shop.
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
@@ -14,7 +14,7 @@ Add these lines to your application's Gemfile **[Recommended]**:
14
14
 
15
15
  ```ruby
16
16
  gem 'capistrano', '~> 3.6'
17
- gem 'capistrano-bundler', '~> 1.3'
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 for skipping the --path flag.
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, '--deployment --quiet' # this is default
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, 4 # default: nil, only available for Bundler >= 1.4
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 command on all servers
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 install \
81
- --binstubs /my_app/shared/bin \
82
- --gemfile /my_app/releases/20130623094732/MyGemfile \
83
- --path /my_app/shared/bundle \
84
- --without development test \
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 command.
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
@@ -2,3 +2,8 @@ require "bundler/gem_tasks"
2
2
 
3
3
  # Do nothing by default
4
4
  task :default
5
+
6
+ Rake::Task["release"].enhance do
7
+ puts "Don't forget to publish the release on GitHub!"
8
+ system "open https://github.com/capistrano/bundler/releases"
9
+ end
@@ -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 = '1.3.0'
7
+ spec.version = '2.0.1'
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.license = 'MIT'
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,9 +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.3'
25
+ spec.add_development_dependency 'bundler', '~> 2.1'
24
26
  spec.add_development_dependency 'danger'
25
27
  spec.add_development_dependency 'rake'
26
28
  end
@@ -1,9 +1,39 @@
1
+ require "shellwords"
2
+
1
3
  namespace :bundler do
2
4
  desc <<-DESC
3
- Install the current Bundler environment. By default, gems will be \
4
- installed to the shared/bundle path. Gems in the development and \
5
- test group will not be installed. The install command is executed \
6
- with the --deployment and --quiet flags.
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, -> { shared_path.join('bin') }
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, '--deployment --quiet'
20
- set :bundle_jobs, nil
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 :install do
55
+ task install: :config do
25
56
  on fetch(:bundle_servers) do
26
57
  within release_path do
27
58
  with fetch(:bundle_env_variables) do
28
- options = []
29
- options << "--gemfile #{fetch(:bundle_gemfile)}" if fetch(:bundle_gemfile)
30
- options << "--path #{fetch(:bundle_path)}" if fetch(:bundle_path)
31
- unless test(:bundle, :check, *options)
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
@@ -53,7 +83,7 @@ namespace :bundler do
53
83
  end
54
84
 
55
85
  desc "Remove unused gems installed by bundler"
56
- task :clean do
86
+ task clean: :config do
57
87
  on fetch(:bundle_servers) do
58
88
  within release_path do
59
89
  with fetch(:bundle_env_variables) do
@@ -73,14 +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)) }
77
109
  set :bundle_binstubs, nil
78
110
  set :bundle_gemfile, nil
79
111
  set :bundle_path, -> { shared_path.join('bundle') }
80
- set :bundle_without, %w{development test}.join(' ')
81
- set :bundle_flags, '--deployment --quiet'
82
- set :bundle_jobs, nil
112
+ set :bundle_without, %w{development test}.join(':')
113
+ set :bundle_flags, '--quiet'
114
+ set :bundle_jobs, 4
83
115
  set :bundle_env_variables, {}
84
116
  set :bundle_clean_options, ""
117
+ set :bundle_check_before_install, true
85
118
  end
86
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: 1.3.0
4
+ version: 2.0.1
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: 2017-09-22 00:00:00.000000000 Z
13
+ date: 2020-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capistrano
@@ -26,34 +26,20 @@ dependencies:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '3.1'
29
- - !ruby/object:Gem::Dependency
30
- name: sshkit
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - "~>"
34
- - !ruby/object:Gem::Version
35
- version: '1.2'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: '1.2'
43
29
  - !ruby/object:Gem::Dependency
44
30
  name: bundler
45
31
  requirement: !ruby/object:Gem::Requirement
46
32
  requirements:
47
33
  - - "~>"
48
34
  - !ruby/object:Gem::Version
49
- version: '1.3'
35
+ version: '2.1'
50
36
  type: :development
51
37
  prerelease: false
52
38
  version_requirements: !ruby/object:Gem::Requirement
53
39
  requirements:
54
40
  - - "~>"
55
41
  - !ruby/object:Gem::Version
56
- version: '1.3'
42
+ version: '2.1'
57
43
  - !ruby/object:Gem::Dependency
58
44
  name: danger
59
45
  requirement: !ruby/object:Gem::Requirement
@@ -91,6 +77,8 @@ executables: []
91
77
  extensions: []
92
78
  extra_rdoc_files: []
93
79
  files:
80
+ - ".github/release-drafter.yml"
81
+ - ".github/workflows/push.yml"
94
82
  - ".gitignore"
95
83
  - ".travis.yml"
96
84
  - CHANGELOG.md
@@ -109,8 +97,9 @@ files:
109
97
  homepage: https://github.com/capistrano/bundler
110
98
  licenses:
111
99
  - MIT
112
- metadata: {}
113
- post_install_message:
100
+ metadata:
101
+ changelog_uri: https://github.com/capistrano/bundler/releases
102
+ post_install_message:
114
103
  rdoc_options: []
115
104
  require_paths:
116
105
  - lib
@@ -125,9 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
114
  - !ruby/object:Gem::Version
126
115
  version: '0'
127
116
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.6.13
130
- signing_key:
117
+ rubygems_version: 3.1.4
118
+ signing_key:
131
119
  specification_version: 4
132
120
  summary: Bundler support for Capistrano 3.x
133
121
  test_files: []