ndr_dev_support 7.3.1 → 7.3.3
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 +4 -4
- data/CHANGELOG.md +19 -0
- data/config/rubocop/ndr.yml +1 -1
- data/lib/ndr_dev_support/capistrano/deploy_secrets.rb +2 -0
- data/lib/ndr_dev_support/capistrano/ndr_model.rb +21 -4
- data/lib/ndr_dev_support/capistrano/preinstall.rb +37 -0
- data/lib/ndr_dev_support/capistrano/revision_logger.rb +1 -5
- data/lib/ndr_dev_support/version.rb +1 -1
- data/lib/tasks/audit_bundle.rake +3 -2
- data/ndr_dev_support.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075d6598048f0b0288649a9ea1c071c33abb11481bdc93dbc7db4cf678ea033c
|
4
|
+
data.tar.gz: d95c2dc791de40932ccf0720b96e9f6ca252842dbe45cb1b02f6344d3a6bdd79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6772091bb99f0f1f70c4d36049789244bcf4f1e1e386510c3e9c603a32d43cbc1fbdb3b78a044e4c973623ce4a29601f4987a95a7b4bc7c884879988bc523845
|
7
|
+
data.tar.gz: 24fcca3b39d2adee7fc8964fd80a404ed60ed6b4a563a06a91ef40c6cae3f0cb4945e8be9f92539b73e16741214ad1500a944280a130baec4f7ebe3bd8d893f9
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
*no unreleased changes*
|
3
3
|
|
4
|
+
## 7.3.3 / 2025-07-31
|
5
|
+
### Fixed
|
6
|
+
* Update rubocop version dependency
|
7
|
+
* rake bundle:update should package gems for all platforms
|
8
|
+
|
9
|
+
## Changed
|
10
|
+
* Drop support for Ruby 3.0
|
11
|
+
|
12
|
+
## 7.3.2 / 2025-05-01
|
13
|
+
### Fixed
|
14
|
+
* Capistrano: Add missing `tmpdir` requirement to deploy application secrets
|
15
|
+
* Capistrano: cap deploy:setup should be safe on existing deployments
|
16
|
+
|
17
|
+
### Added
|
18
|
+
* Capistrano: add task deploy:preinstall to preinstall ruby and bundled gems
|
19
|
+
|
20
|
+
## Changed
|
21
|
+
* Drop support for Rails 6.1
|
22
|
+
|
4
23
|
## 7.3.1 / 2025-01-02
|
5
24
|
### Added
|
6
25
|
* Capistrano: deploy application secrets from a subversion or git repository
|
data/config/rubocop/ndr.yml
CHANGED
@@ -4,6 +4,7 @@ require 'rainbow'
|
|
4
4
|
require_relative 'assets'
|
5
5
|
require_relative 'deploy_secrets'
|
6
6
|
require_relative 'install_ruby'
|
7
|
+
require_relative 'preinstall'
|
7
8
|
require_relative 'restart'
|
8
9
|
require_relative 'revision_logger'
|
9
10
|
require_relative 'ruby_version'
|
@@ -53,11 +54,15 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
53
54
|
# sticky; all deployments made within it should be owned by the deployer group too. This
|
54
55
|
# means that e.g. a deployment by "bob.smith" can then be rolled back by "tom.jones".
|
55
56
|
run "mkdir -p #{deploy_to}"
|
56
|
-
|
57
|
+
# Set deployer group for everything created by this user
|
58
|
+
# run "chgrp -R deployer #{deploy_to}"
|
59
|
+
run "find #{deploy_to} -group #{fetch(:user)} -print0 |xargs -r0 chgrp -h deployer"
|
57
60
|
|
58
61
|
# The sticky group will apply automatically to new subdirectories, but
|
59
62
|
# any existing subdirectories will need it manually applying via `-R`.
|
60
|
-
run "chmod -R g+s #{deploy_to}"
|
63
|
+
# run "chmod -R g+s #{deploy_to}"
|
64
|
+
run "find #{deploy_to} -user #{fetch(:user)} -type d " \
|
65
|
+
'-not -perm -2000 -print0 |xargs -r0 chmod g+s'
|
61
66
|
end
|
62
67
|
|
63
68
|
desc 'Custom tasks to be run once, after the initial `cap setup`'
|
@@ -67,8 +72,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
67
72
|
run "mkdir -p #{full_path}"
|
68
73
|
|
69
74
|
# Allow the application to write into here:
|
70
|
-
run "chgrp -R #{application_group} #{full_path}"
|
71
|
-
run "chmod -R g+s #{full_path}"
|
75
|
+
# run "chgrp -R #{application_group} #{full_path}"
|
76
|
+
# run "chmod -R g+s #{full_path}"
|
77
|
+
run "find #{full_path} -user #{fetch(:user)} -not -group #{application_group} " \
|
78
|
+
"-print0 |xargs -r0 chgrp -h #{application_group}"
|
79
|
+
run "find #{full_path} -user #{fetch(:user)} -type d " \
|
80
|
+
'-not -perm -2000 -print0 |xargs -r0 chmod g+s'
|
72
81
|
end
|
73
82
|
|
74
83
|
fetch(:shared_paths, []).each do |path|
|
@@ -185,6 +194,14 @@ def target_ruby_version_for(env)
|
|
185
194
|
match ? match[:version] : raise('Unrecognized Ruby version!')
|
186
195
|
end
|
187
196
|
|
197
|
+
def log_deployment_message(msg)
|
198
|
+
name = fetch(:deployer_name, capture('id -un').chomp)
|
199
|
+
log = File.join(shared_path, 'revisions.log')
|
200
|
+
msg = "[#{Time.now}] #{name} #{msg}" # rubocop:disable Rails/TimeZone
|
201
|
+
|
202
|
+
run "(test -e #{log} || (touch #{log} && chmod 664 #{log})) && echo #{Shellwords.escape(msg)} >> #{log};"
|
203
|
+
end
|
204
|
+
|
188
205
|
def add_target(env, name, app, port, app_user, is_web_server)
|
189
206
|
desc "Deploy to #{env} service #{app_user || 'you'}@#{app}:#{port}"
|
190
207
|
task(name) do
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
namespace :deploy do
|
3
|
+
desc <<~DESC
|
4
|
+
Preinstall ruby and gems, then abort and rollback cleanly, leaving the
|
5
|
+
current installation unchanged.
|
6
|
+
|
7
|
+
This is particularly useful for ruby version bumps: installing the new
|
8
|
+
ruby version and all the bundled gems can take a long time.
|
9
|
+
|
10
|
+
This aborts before updating out-of-bundle gems, in case that causes
|
11
|
+
issues when restarting the currently installed version.
|
12
|
+
|
13
|
+
Usage:
|
14
|
+
cap target deploy:preinstall
|
15
|
+
DESC
|
16
|
+
task :preinstall do
|
17
|
+
# Running this task sets a flag, to make ndr_dev_support:check_preinstall abort.
|
18
|
+
# We do this in a roundabout way on Capistrano 2, because deploy:update_code
|
19
|
+
# explicitly runs deploy:finalize_update, instead of using task dependencies.
|
20
|
+
set :preinstall, true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
namespace :ndr_dev_support do
|
25
|
+
desc 'Hook to abort capistrano installation early after preinstalling ruby and in-bundle gems'
|
26
|
+
task :check_preinstall do
|
27
|
+
next unless fetch(:preinstall, false)
|
28
|
+
|
29
|
+
log_deployment_message("preinstalled #{real_revision}")
|
30
|
+
warn Rainbow("Successful preinstall for target: #{fetch(:name)}")
|
31
|
+
abort 'Aborting after successful preinstall'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
after 'deploy:preinstall', 'deploy:update'
|
36
|
+
before 'ndr_dev_support:update_out_of_bundle_gems', 'ndr_dev_support:check_preinstall'
|
37
|
+
end
|
@@ -2,11 +2,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
2
2
|
namespace :ndr_dev_support do
|
3
3
|
desc 'Append to the log of deployments the user and revision.'
|
4
4
|
task :log_deployment, except: { no_release: true } do
|
5
|
-
|
6
|
-
log = File.join(shared_path, 'revisions.log')
|
7
|
-
msg = "[#{Time.now}] #{name} deployed #{latest_revision}"
|
8
|
-
|
9
|
-
run "(test -e #{log} || (touch #{log} && chmod 664 #{log})) && echo #{msg} >> #{log};"
|
5
|
+
log_deployment_message("deployed #{latest_revision}")
|
10
6
|
end
|
11
7
|
end
|
12
8
|
|
data/lib/tasks/audit_bundle.rake
CHANGED
@@ -138,11 +138,12 @@ namespace :bundle do
|
|
138
138
|
end
|
139
139
|
|
140
140
|
# Retrieve binary gems for platforms listed in Gemfile.lock
|
141
|
-
platforms = `bundle platform`.split("\n").grep(/^[*] x86_64-/).collect { |s| s[2..] }
|
142
141
|
Dir.chdir('vendor/cache') do
|
142
|
+
platforms = `bundle platform`.split("\n").grep(/^[*] x86_64-/).collect { |s| s[2..] }
|
143
143
|
platforms.each do |platform|
|
144
144
|
system("gem fetch #{gem} --version=#{new_gem_version2} --platform=#{platform}")
|
145
145
|
end
|
146
|
+
system('bundle package --all-platforms')
|
146
147
|
end if Dir.exist?('vendor/cache')
|
147
148
|
|
148
149
|
if gem == 'webpacker'
|
@@ -206,7 +207,7 @@ namespace :bundle do
|
|
206
207
|
|
207
208
|
$ ( git rm #{files_to_git_rm.join(' ')}
|
208
209
|
git add #{files_to_git_add.join(' ')}
|
209
|
-
git commit -m '
|
210
|
+
git commit -m 'Bump #{gem} to #{new_gem_version2}'
|
210
211
|
)
|
211
212
|
MSG
|
212
213
|
end
|
data/ndr_dev_support.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.required_ruby_version = '>= 3.
|
23
|
+
spec.required_ruby_version = '>= 3.1'
|
24
24
|
|
25
25
|
spec.add_dependency 'pry'
|
26
26
|
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
# Rubocop dependencies:
|
32
32
|
spec.add_dependency 'parser'
|
33
33
|
spec.add_dependency 'rainbow'
|
34
|
-
spec.add_dependency 'rubocop', '~> 1.
|
34
|
+
spec.add_dependency 'rubocop', '~> 1.72'
|
35
35
|
spec.add_dependency 'rubocop-rails', '~> 2.9'
|
36
36
|
spec.add_dependency 'rubocop-rake', '~> 0.5'
|
37
37
|
spec.add_dependency 'unicode-display_width', '>= 1.3.3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_dev_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.3.
|
4
|
+
version: 7.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01
|
11
|
+
date: 2025-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.72'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
96
|
+
version: '1.72'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -412,6 +412,7 @@ files:
|
|
412
412
|
- lib/ndr_dev_support/capistrano/deploy_secrets.rb
|
413
413
|
- lib/ndr_dev_support/capistrano/install_ruby.rb
|
414
414
|
- lib/ndr_dev_support/capistrano/ndr_model.rb
|
415
|
+
- lib/ndr_dev_support/capistrano/preinstall.rb
|
415
416
|
- lib/ndr_dev_support/capistrano/restart.rb
|
416
417
|
- lib/ndr_dev_support/capistrano/revision_logger.rb
|
417
418
|
- lib/ndr_dev_support/capistrano/ruby_version.rb
|
@@ -479,14 +480,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
479
480
|
requirements:
|
480
481
|
- - ">="
|
481
482
|
- !ruby/object:Gem::Version
|
482
|
-
version: '3.
|
483
|
+
version: '3.1'
|
483
484
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
484
485
|
requirements:
|
485
486
|
- - ">="
|
486
487
|
- !ruby/object:Gem::Version
|
487
488
|
version: '0'
|
488
489
|
requirements: []
|
489
|
-
rubygems_version: 3.
|
490
|
+
rubygems_version: 3.4.19
|
490
491
|
signing_key:
|
491
492
|
specification_version: 4
|
492
493
|
summary: NDR Developer Support library
|