capistrano-rails 1.3.0 → 1.6.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: dcd91a978e99c58547d28d3049fec73695c4f518
4
- data.tar.gz: f6e20bd2b13cdc0f55e39b1bcf2fdad3d16cc4b5
2
+ SHA256:
3
+ metadata.gz: 7d76466b0fb795e270e25110b88f38bfb6d67a55a45e46a90fb0b0e755f86a76
4
+ data.tar.gz: ca2b9eb9d4dd79fb42dcb82c430c5a3549d72644366dbce22a518779570e2992
5
5
  SHA512:
6
- metadata.gz: 8be01bc08a5084597616374ce6497038c69ebba06a42832b2b64edb56130720e1c2f7ed3106274befa02706f67630b94a9c2efb6ff082523fc1d87a2cc7bfe3a
7
- data.tar.gz: 53d8decbff18ca1d824a8032b9118ff687c2403a1733b02b7d138fc17eaa0aabe5933c6096c67a66f05ad9a464d3b9beb0b34965039f757465bc3465a6313f75
6
+ metadata.gz: f80894d373016df435d82ebb3d0f6db6d6d6c96ac58dfe8faf66e53cd4f28a7a7fc3b709e48ea94e55d49892afab5fe561a8b2b17ddbf51a9e5490a820f3d370
7
+ data.tar.gz: aa00024a5e38aa9f36427ef80b497f053168ac740e40da3b4ca3ee9080573f3c2931a0bc4a0c6f6b39c2a1c26322bac4bf8e16a1a0d097205f4f7e0eaac003fb
@@ -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,85 +1 @@
1
- # [master][]
2
-
3
- * Your contribution here!
4
-
5
- # [1.3.0][] (Jun 9 2017)
6
-
7
- * rails_assets_groups config option to set RAILS_GROUPS (https://github.com/capistrano/rails/pull/135)
8
-
9
- # [1.2.3][] (Mar 4 2017)
10
-
11
- * [#200](https://github.com/capistrano/rails/pull/200): Don't link public/assets if public is already linked - [@mattbrictson](https://github.com/mattbrictson)
12
-
13
- # [1.2.2][] (Jan 10 2017)
14
-
15
- * Restored compatibility with older versions of Rake (< 11.0.0), introduced in previous change. (@toupeira)
16
-
17
- # [1.2.1][] (Dec 23 2016)
18
-
19
- * Diff db directory recursively
20
- * Avoid warning while running migrations on multiple servers (#189)
21
-
22
- # [1.2.0][] (Oct 25 2016)
23
-
24
- * Diff entire db directory when determining if migrations are needed
25
-
26
- # 1.1.8 (Sep 13 2016)
27
-
28
- * Handle arrays passed into `normalize_asset_timestamps` correctly (#184)
29
-
30
- # 1.1.7 (Jun 10 2016)
31
-
32
- * call `Array#uniq` in `deploy:set_linked_dirs` task to remove duplicated :linked_dirs
33
- * Add `migration_servers` configuration (#168)
34
-
35
- # 1.1.6 (Jan 19 2016)
36
-
37
- * Add `rake assets:clobber` task from Rails (#149)
38
- * Make `assets:clean` capable with zsh (#150)
39
- * Split `deploy:migrate` to allow for finer hook-control (#148)
40
- * Fix for parsing ls output in detect_manifest_path (#133)
41
-
42
- # 1.1.5 (Oct 15 2015)
43
-
44
- * 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.
45
-
46
- # 1.1.4 (Oct 10 2015)
47
-
48
- * Fixing bug with normalize_assets typo #138
49
- * Cleanup assets after:updated (#136)
50
- * Fixed linked_dirs containing default value of assets_prefix (#125)
51
-
52
- # 1.1.3 (Apr 18 2015)
53
-
54
- * Fixed no_release behaviour (https://github.com/capistrano/rails/pull/95)
55
- * Allow assets manifest backup with folder "manifests" (https://github.com/capistrano/rails/pull/92)
56
- * Handle Sprocket 3 manifest filename
57
-
58
- # 1.1.2 (Sep 1 2014)
59
-
60
- * rails_env is set before deploy (https://github.com/capistrano/rails/pull/66)
61
- * with `conditionally_migrate` option enabled you can skip `db:migrate` if there were no new migrations (https://github.com/capistrano/rails/pull/71)
62
- * Allow early overriding of assets_* parameters (https://github.com/capistrano/rails/pull/73)
63
-
64
- # 1.1.1
65
-
66
- * New `asset_roles` options: https://github.com/capistrano/rails/pull/30
67
- * normalized task spelling: 'deploy:normalise_assets' is now 'deploy:normalize_assets'
68
- * depend on capistrano 3.1 to support multiple role arguments
69
-
70
- # 1.1.0
71
-
72
- * set rails_env even if capistrano-rails was required partly
73
- * depend on capistrano-bundler
74
- * require bundler with capistrano-rails/all
75
-
76
- # 1.0.0
77
-
78
- Initial release
79
-
80
- [master]: https://github.com/capistrano/rails/compare/v1.3.0...HEAD
81
- [1.3.0]: https://github.com/capistrano/rails/compare/v1.2.2...v1.3.0
82
- [1.2.3]: https://github.com/capistrano/rails/compare/v1.2.2...v1.2.3
83
- [1.2.2]: https://github.com/capistrano/rails/compare/v1.2.1...v1.2.2
84
- [1.2.1]: https://github.com/capistrano/rails/compare/v1.2.0...v1.2.1
85
- [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 +1 @@
1
- danger.import_dangerfile(github: "capistrano/danger")
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.3'
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,10 @@ 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
+
74
81
  # RAILS_GROUPS env value for the assets:precompile task. Default to nil.
75
82
  set :rails_assets_groups, :assets
76
83
 
@@ -90,10 +97,12 @@ Make sure you enable it by setting `linked_dirs` and `linked_files` options:
90
97
 
91
98
  ```ruby
92
99
  # deploy.rb
93
- set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
94
- 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'
95
102
  ```
96
103
 
104
+ In capistrano < 3.5, before `append` was introduced, you can use `fetch` and `push` to get the same result.
105
+
97
106
  ### Recommendations
98
107
 
99
108
  While migrations looks like a concern of the database layer, Rails migrations
@@ -107,6 +116,26 @@ set :migration_role, :app
107
116
  The advantage is you won't need to deploy your application to your database
108
117
  server, and overall a better separation of concerns.
109
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
+
110
139
  ## Contributing
111
140
 
112
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.3.0'
7
+ gem.version = '1.6.1'
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
@@ -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.3.0
4
+ version: 1.6.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-06-09 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.12
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: []