capistrano-rails 1.2.3 → 1.6.0

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: 93ee128ca34535796679242e1deb36e7161866c7
4
- data.tar.gz: aa19837eb01747fa078d1e3ad97ea03e3f20ef36
2
+ SHA256:
3
+ metadata.gz: bf5fe872b93d5cc6d75a75eb8073a25641b7d7bbb634eddb0feb535f35f4920f
4
+ data.tar.gz: f830510ee60ff110c8f388a00c5274976feb9cafc29cbcce2f2bafd5dbcce88f
5
5
  SHA512:
6
- metadata.gz: e6b3dfed673f8f95cad698f01fef2616dd94c78bf28171cd1ca63cb702b5821dbb5cad30e861866999c6f20e3c5de1ea9aa7db4616971931060649235ed0ed32
7
- data.tar.gz: 937c98a295cf5da311dc8cde4b7a6b248f255dc41e6803f3adb5cbe6924e35b18da51f3c02ee4232b9b4f9ac10fa1e4e70c29f03adb30843712552abfe6fa2b8
6
+ metadata.gz: 9112045c5ed9155ea46d66bf90abc8b88b28d8673b9a13af088e84335f0fe6cfc17e85f37d2969ab0453500dc76825bb22e6243c7401eeebf628e9501bd1b81c
7
+ data.tar.gz: cefd7a9cb603abccf1fad9c52d7cc2e09440770b888b8d9f2bafb2a83df55fff7257e1bed28c82fca33532a09b6bd57903e3668289a6d51b17345c961659627c
@@ -0,0 +1,19 @@
1
+ **Important:** GitHub issues are for feature requests or bug reports. The Capistrano team recommends you use [Stack Overflow](http://stackoverflow.com/questions/tagged/capistrano) for general questions. For more details, please see our [contribution policy](https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md).
2
+
3
+ ---
4
+
5
+ ### Steps to reproduce
6
+ If reasonable, you can help by creating a Capistrano skeleton example project which reproduces the issue you are seeing. You can then upload the individual files to a GitHub Gist or a GitHub project. Others can simply modify the configuration to point at a test server/repository of their own. Often times, an issue is resolved simply by making this test case.
7
+
8
+ An example test case is here: https://gist.github.com/will-in-wi/527327e31af30b3eae2068e2965be05b
9
+
10
+ ### Expected behavior
11
+ Tell us what should happen
12
+
13
+ ### Actual behavior
14
+ Tell us what happens instead
15
+
16
+ ### System configuration
17
+ Please link to the output of `cap <stage> doctor` in a GitHub Gist.
18
+
19
+ Thanks for helping improve Capistrano!
@@ -0,0 +1,23 @@
1
+ ### Summary
2
+
3
+ (Guidelines for creating a bug report are available
4
+ here: https://github.com/capistrano/capistrano/blob/master/DEVELOPMENT.md)
5
+
6
+ Provide a general description of the code changes in your pull
7
+ request... were there any bugs you had fixed? If so, mention them. If
8
+ these bugs have open GitHub issues, be sure to tag them here as well,
9
+ to keep the conversation linked together.
10
+
11
+ ### Short checklist
12
+
13
+ - [ ] If you are fixing a bug or introducing a new feature, did you add a CHANGELOG entry?
14
+
15
+ ### Other Information
16
+
17
+ If there's anything else that's important and relevant to your pull
18
+ request, mention that information here.
19
+
20
+ If you are updating any of the CHANGELOG files or are asked to update the
21
+ CHANGELOG files by reviewers, please add the CHANGELOG entry at the top of the file where indicated.
22
+
23
+ Thanks for helping improve Capistrano!
@@ -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,80 +1 @@
1
- # [master][]
2
-
3
- * Your contribution here!
4
-
5
- # [1.2.3][] (Mar 4 2017)
6
-
7
- * [#200](https://github.com/capistrano/rails/pull/200): Don't link public/assets if public is already linked - [@mattbrictson](https://github.com/mattbrictson)
8
-
9
- # [1.2.2][] (Jan 10 2017)
10
-
11
- * Restored compatibility with older versions of Rake (< 11.0.0), introduced in previous change. (@toupeira)
12
-
13
- # [1.2.1][] (Dec 23 2016)
14
-
15
- * Diff db directory recursively
16
- * Avoid warning while running migrations on multiple servers (#189)
17
-
18
- # [1.2.0][] (Oct 25 2016)
19
-
20
- * Diff entire db directory when determining if migrations are needed
21
-
22
- # 1.1.8 (Sep 13 2016)
23
-
24
- * Handle arrays passed into `normalize_asset_timestamps` correctly (#184)
25
-
26
- # 1.1.7 (Jun 10 2016)
27
-
28
- * call `Array#uniq` in `deploy:set_linked_dirs` task to remove duplicated :linked_dirs
29
- * Add `migration_servers` configuration (#168)
30
-
31
- # 1.1.6 (Jan 19 2016)
32
-
33
- * Add `rake assets:clobber` task from Rails (#149)
34
- * Make `assets:clean` capable with zsh (#150)
35
- * Split `deploy:migrate` to allow for finer hook-control (#148)
36
- * Fix for parsing ls output in detect_manifest_path (#133)
37
-
38
- # 1.1.5 (Oct 15 2015)
39
-
40
- * Disable `deploy:cleanup_assets` by default due to undesirable behavior in Rails 3. Use `set :keep_assets, 2` to explicitly enable this feature for Rails 4.
41
-
42
- # 1.1.4 (Oct 10 2015)
43
-
44
- * Fixing bug with normalize_assets typo #138
45
- * Cleanup assets after:updated (#136)
46
- * Fixed linked_dirs containing default value of assets_prefix (#125)
47
-
48
- # 1.1.3 (Apr 18 2015)
49
-
50
- * Fixed no_release behaviour (https://github.com/capistrano/rails/pull/95)
51
- * Allow assets manifest backup with folder "manifests" (https://github.com/capistrano/rails/pull/92)
52
- * Handle Sprocket 3 manifest filename
53
-
54
- # 1.1.2 (Sep 1 2014)
55
-
56
- * rails_env is set before deploy (https://github.com/capistrano/rails/pull/66)
57
- * with `conditionally_migrate` option enabled you can skip `db:migrate` if there were no new migrations (https://github.com/capistrano/rails/pull/71)
58
- * Allow early overriding of assets_* parameters (https://github.com/capistrano/rails/pull/73)
59
-
60
- # 1.1.1
61
-
62
- * New `asset_roles` options: https://github.com/capistrano/rails/pull/30
63
- * normalized task spelling: 'deploy:normalise_assets' is now 'deploy:normalize_assets'
64
- * depend on capistrano 3.1 to support multiple role arguments
65
-
66
- # 1.1.0
67
-
68
- * set rails_env even if capistrano-rails was required partly
69
- * depend on capistrano-bundler
70
- * require bundler with capistrano-rails/all
71
-
72
- # 1.0.0
73
-
74
- Initial release
75
-
76
- [master]: https://github.com/capistrano/rails/compare/v1.2.3...HEAD
77
- [1.2.3]: https://github.com/capistrano/rails/compare/v1.2.2...v1.2.3
78
- [1.2.2]: https://github.com/capistrano/rails/compare/v1.2.1...v1.2.2
79
- [1.2.1]: https://github.com/capistrano/rails/compare/v1.2.0...v1.2.1
80
- [1.2.0]: https://github.com/capistrano/rails/compare/v1.1.8...v1.2.0
1
+ Release notes for this project are kept here: https://github.com/capistrano/rails/releases
data/Dangerfile CHANGED
@@ -1,43 +1 @@
1
- # Adapted from https://github.com/ruby-grape/danger/blob/master/Dangerfile
2
- # Q: What is a Dangerfile, anyway? A: See http://danger.systems/
3
-
4
- # ------------------------------------------------------------------------------
5
- # Additional pull request data
6
- # ------------------------------------------------------------------------------
7
- project_name = github.pr_json["base"]["repo"]["name"]
8
- pr_number = github.pr_json["number"]
9
- pr_url = github.pr_json["_links"]["html"]["href"]
10
-
11
- # ------------------------------------------------------------------------------
12
- # What changed?
13
- # ------------------------------------------------------------------------------
14
- has_lib_changes = !git.modified_files.grep(/^lib/).empty?
15
- has_changelog_changes = git.modified_files.include?("CHANGELOG.md")
16
-
17
- # ------------------------------------------------------------------------------
18
- # Have you updated CHANGELOG.md?
19
- # ------------------------------------------------------------------------------
20
- if !has_changelog_changes && has_lib_changes
21
- markdown <<-MARKDOWN
22
- Here's an example of a CHANGELOG.md entry (place it immediately under the `* Your contribution here!` line):
23
-
24
- ```markdown
25
- * [##{pr_number}](#{pr_url}): #{github.pr_title} - [@#{github.pr_author}](https://github.com/#{github.pr_author}).
26
- ```
27
- MARKDOWN
28
- warn("Please update CHANGELOG.md with a description of your changes. "\
29
- "If this PR is not a user-facing change (e.g. just refactoring), "\
30
- "you can disregard this.", :sticky => false)
31
- end
32
-
33
- # ------------------------------------------------------------------------------
34
- # Did you remove the CHANGELOG's "Your contribution here!" line?
35
- # ------------------------------------------------------------------------------
36
- if has_changelog_changes
37
- unless IO.read("CHANGELOG.md") =~ /^\* Your contribution here/i
38
- fail(
39
- "Please put the `* Your contribution here!` line back into CHANGELOG.md.",
40
- :sticky => false
41
- )
42
- end
43
- end
1
+ danger.import_dangerfile(github: "capistrano/danger", branch: "no-changelog")
data/README.md CHANGED
@@ -7,12 +7,12 @@ Rails specific tasks for Capistrano v3:
7
7
 
8
8
  ## Installation
9
9
 
10
- Add these lines to your application's Gemfile:
10
+ Add these Capistrano gems to your application's Gemfile using `require: false`:
11
11
 
12
12
  ```ruby
13
13
  group :development do
14
- gem 'capistrano', '~> 3.6'
15
- gem 'capistrano-rails', '~> 1.2'
14
+ gem "capistrano", "~> 3.10", require: false
15
+ gem "capistrano-rails", "~> 1.6", require: false
16
16
  end
17
17
  ```
18
18
 
@@ -60,6 +60,9 @@ set :migration_role, :db
60
60
  # Defaults to the primary :db server
61
61
  set :migration_servers, -> { primary(fetch(:migration_role)) }
62
62
 
63
+ # Defaults to `db:migrate`
64
+ set :migration_command, 'db:migrate'
65
+
63
66
  # Defaults to false
64
67
  # Skip migration if files in db/migrate were not modified
65
68
  set :conditionally_migrate, true
@@ -71,6 +74,13 @@ set :assets_roles, [:web, :app]
71
74
  # This should match config.assets.prefix in your rails config/application.rb
72
75
  set :assets_prefix, 'prepackaged-assets'
73
76
 
77
+ # Defaults to ["/path/to/release_path/public/#{fetch(:assets_prefix)}/.sprockets-manifest*", "/path/to/release_path/public/#{fetch(:assets_prefix)}/manifest*.*"]
78
+ # This should match config.assets.manifest in your rails config/application.rb
79
+ set :assets_manifests, ['app/assets/config/manifest.js']
80
+
81
+ # RAILS_GROUPS env value for the assets:precompile task. Default to nil.
82
+ set :rails_assets_groups, :assets
83
+
74
84
  # If you need to touch public/images, public/javascripts, and public/stylesheets on each deploy
75
85
  set :normalize_asset_timestamps, %w{public/images public/javascripts public/stylesheets}
76
86
 
@@ -87,10 +97,12 @@ Make sure you enable it by setting `linked_dirs` and `linked_files` options:
87
97
 
88
98
  ```ruby
89
99
  # deploy.rb
90
- set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
91
- set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
100
+ append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', '.bundle', 'public/system', 'public/uploads'
101
+ append :linked_files, 'config/database.yml', 'config/secrets.yml'
92
102
  ```
93
103
 
104
+ In capistrano < 3.5, before `append` was introduced, you can use `fetch` and `push` to get the same result.
105
+
94
106
  ### Recommendations
95
107
 
96
108
  While migrations looks like a concern of the database layer, Rails migrations
@@ -104,6 +116,26 @@ set :migration_role, :app
104
116
  The advantage is you won't need to deploy your application to your database
105
117
  server, and overall a better separation of concerns.
106
118
 
119
+ #### Uploading your master.key
120
+
121
+ You can use the below configuration to upload your `master.key` to the server if it isn't already present.
122
+
123
+ ```ruby
124
+ append :linked_files, "config/master.key"
125
+
126
+ namespace :deploy do
127
+ namespace :check do
128
+ before :linked_files, :set_master_key do
129
+ on roles(:app), in: :sequence, wait: 10 do
130
+ unless test("[ -f #{shared_path}/config/master.key ]")
131
+ upload! 'config/master.key', "#{shared_path}/config/master.key"
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
137
+ ```
138
+
107
139
  ## Contributing
108
140
 
109
141
  1. Fork it
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/rails/releases"
9
+ end
@@ -4,19 +4,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "capistrano-rails"
7
- gem.version = '1.2.3'
7
+ gem.version = '1.6.0'
8
8
  gem.authors = ["Tom Clements", "Lee Hambley", "Kir Shatrov"]
9
9
  gem.email = ["seenmyfate@gmail.com", "lee.hambley@gmail.com", "shatrov@me.com"]
10
10
  gem.description = %q{Rails specific Capistrano tasks}
11
11
  gem.summary = %q{Rails specific Capistrano tasks}
12
12
  gem.homepage = "https://github.com/capistrano/rails"
13
+ gem.metadata = {
14
+ "changelog_uri" => "https://github.com/capistrano/rails/releases"
15
+ }
16
+
17
+ gem.licenses = ["MIT"]
13
18
 
14
19
  gem.files = `git ls-files`.split($/)
15
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
21
  gem.require_paths = ["lib"]
17
22
 
18
23
  gem.add_dependency 'capistrano', '~> 3.1'
19
- gem.add_dependency 'capistrano-bundler', '~> 1.1'
24
+ gem.add_dependency 'capistrano-bundler', '>= 1.1', '< 3'
20
25
 
21
26
  gem.add_development_dependency 'danger'
22
27
  end
@@ -65,7 +65,7 @@ namespace :deploy do
65
65
  task :precompile do
66
66
  on release_roles(fetch(:assets_roles)) do
67
67
  within release_path do
68
- with rails_env: fetch(:rails_env) do
68
+ with rails_env: fetch(:rails_env), rails_groups: fetch(:rails_assets_groups) do
69
69
  execute :rake, "assets:precompile"
70
70
  end
71
71
  end
@@ -88,10 +88,15 @@ namespace :deploy do
88
88
  task :restore_manifest do
89
89
  on release_roles(fetch(:assets_roles)) do
90
90
  within release_path do
91
- target = detect_manifest_path
92
- source = release_path.join('assets_manifest_backup', File.basename(target))
93
- if test "[[ -f #{source} && -f #{target} ]]"
94
- execute :cp, source, target
91
+ targets = detect_manifest_path.split(' ')
92
+ sources = targets.map do |target|
93
+ release_path.join('assets_manifest_backup', File.basename(target))
94
+ end
95
+ if test(:ls, *sources) && test(:ls, *targets)
96
+ source_map = sources.zip(targets)
97
+ source_map.each do |source, target|
98
+ execute :cp, source, target
99
+ end
95
100
  else
96
101
  msg = 'Rails assets manifest file (or backup file) not found.'
97
102
  warn msg
@@ -102,12 +107,8 @@ namespace :deploy do
102
107
  end
103
108
 
104
109
  def detect_manifest_path
105
- %w(
106
- .sprockets-manifest*
107
- manifest*.*
108
- ).each do |pattern|
109
- candidate = release_path.join('public', fetch(:assets_prefix), pattern)
110
- return capture(:ls, candidate).strip.gsub(/(\r|\n)/,' ') if test(:ls, candidate)
110
+ fetch(:assets_manifests).each do |candidate|
111
+ return capture(:ls, candidate).strip.gsub(/(\r|\n)/, ' ') if test(:ls, candidate)
111
112
  end
112
113
  msg = 'Rails assets manifest file not found.'
113
114
  warn msg
@@ -134,5 +135,10 @@ namespace :load do
134
135
  task :defaults do
135
136
  set :assets_roles, fetch(:assets_roles, [:web])
136
137
  set :assets_prefix, fetch(:assets_prefix, 'assets')
138
+ set :assets_manifests, -> {
139
+ %w[.sprockets-manifest* manifest*.*].map do |pattern|
140
+ release_path.join("public", fetch(:assets_prefix), pattern)
141
+ end
142
+ }
137
143
  end
138
144
  end
@@ -22,7 +22,7 @@ namespace :deploy do
22
22
  on fetch(:migration_servers) do
23
23
  within release_path do
24
24
  with rails_env: fetch(:rails_env) do
25
- execute :rake, 'db:migrate'
25
+ execute :rake, fetch(:migration_command)
26
26
  end
27
27
  end
28
28
  end
@@ -36,5 +36,6 @@ namespace :load do
36
36
  set :conditionally_migrate, fetch(:conditionally_migrate, false)
37
37
  set :migration_role, fetch(:migration_role, :db)
38
38
  set :migration_servers, -> { primary(fetch(:migration_role)) }
39
+ set :migration_command, -> { fetch(:migration_command, 'db:migrate') }
39
40
  end
40
41
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.6.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: 2017-03-04 00:00:00.000000000 Z
13
+ date: 2020-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capistrano
@@ -30,16 +30,22 @@ dependencies:
30
30
  name: capistrano-bundler
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.1'
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '3'
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
- - - "~>"
43
+ - - ">="
41
44
  - !ruby/object:Gem::Version
42
45
  version: '1.1'
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '3'
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: danger
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -63,6 +69,10 @@ executables: []
63
69
  extensions: []
64
70
  extra_rdoc_files: []
65
71
  files:
72
+ - ".github/issue_template.md"
73
+ - ".github/pull_request_template.md"
74
+ - ".github/release-drafter.yml"
75
+ - ".github/workflows/push.yml"
66
76
  - ".gitignore"
67
77
  - ".travis.yml"
68
78
  - CHANGELOG.md
@@ -80,9 +90,11 @@ files:
80
90
  - lib/capistrano/tasks/migrations.rake
81
91
  - lib/capistrano/tasks/set_rails_env.rake
82
92
  homepage: https://github.com/capistrano/rails
83
- licenses: []
84
- metadata: {}
85
- post_install_message:
93
+ licenses:
94
+ - MIT
95
+ metadata:
96
+ changelog_uri: https://github.com/capistrano/rails/releases
97
+ post_install_message:
86
98
  rdoc_options: []
87
99
  require_paths:
88
100
  - lib
@@ -97,9 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
109
  - !ruby/object:Gem::Version
98
110
  version: '0'
99
111
  requirements: []
100
- rubyforge_project:
101
- rubygems_version: 2.6.10
102
- signing_key:
112
+ rubygems_version: 3.1.4
113
+ signing_key:
103
114
  specification_version: 4
104
115
  summary: Rails specific Capistrano tasks
105
116
  test_files: []