ndr_dev_support 7.3.4 → 7.3.6
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 +9 -0
- data/lib/ndr_dev_support/capistrano/bundler_deployment.rb +100 -0
- data/lib/ndr_dev_support/capistrano/macos_bsdtar.rb +33 -0
- data/lib/ndr_dev_support/capistrano/ndr_model.rb +2 -0
- data/lib/ndr_dev_support/version.rb +1 -1
- data/ndr_dev_support.gemspec +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 589fcf9c03c62ecbeecffbfe9020e87a7a1d5deec59506eef8129592504ae1c7
|
|
4
|
+
data.tar.gz: 8e99fb0d7c43f670c8684fdd11e570df00d69895e18f16194dd70a4f1afd6047
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 768b8c51a8653ce8866a322fcb2bcf7548bb42a4ce8d133b5e397f961bb143c0b8f2820eb9e5a67d211bb6304d125359ea8f210456604cc4d1d0e62374c50545
|
|
7
|
+
data.tar.gz: ff1eb7652b61497650afd78d9fb9bd0a8f366b6bcc972240f6c07f6e4529015e0fede07f4787eb965acd848348cbb966ddcd17c1566cc0fb57b9172cc10141f2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
*no unreleased changes*
|
|
3
3
|
|
|
4
|
+
## 7.3.6 / 2026-01-13
|
|
5
|
+
### Added
|
|
6
|
+
* Support Rails 8.1, Ruby 4.0
|
|
7
|
+
* capistrano: Support bundler 4 with capistrano 2
|
|
8
|
+
|
|
9
|
+
## 7.3.5 / 2025-10-16
|
|
10
|
+
### Fixed
|
|
11
|
+
* Capistrano: Do not include macOS extended attributes in tar files
|
|
12
|
+
|
|
4
13
|
## 7.3.4 / 2025-09-26
|
|
5
14
|
### Fixed
|
|
6
15
|
* Capistrano: deploy:preinstall should fix up installed gem permissions
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Support capistrano 2 with old (< 4) and new (>= 4) bundler versions
|
|
2
|
+
#
|
|
3
|
+
# Add "require 'ndr_dev_support/capistrano/ndr_model'" in your Capistrano deploy.rb,
|
|
4
|
+
# but remove calls to "require 'bundler/capistrano'", and
|
|
5
|
+
# Bundler will be activated after each new deployment.
|
|
6
|
+
|
|
7
|
+
unless defined?(Bundler::Deployment)
|
|
8
|
+
# Redefine deployment helpers for Capistrano 2, previously defined in bundler < 4
|
|
9
|
+
# cf. https://blog.rubygems.org/2025/12/03/upgrade-to-rubygems-bundler-4.html
|
|
10
|
+
# Code copied from bundler 2 source files bundler/deployment.rb and bundler/capistrano.rb
|
|
11
|
+
# then modified to support bundler >= 2
|
|
12
|
+
# rubocop:disable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
|
|
13
|
+
module Bundler
|
|
14
|
+
class Deployment
|
|
15
|
+
def self.define_task(context, task_method = :task, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity
|
|
16
|
+
if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
|
|
17
|
+
context_name = "capistrano"
|
|
18
|
+
role_default = "{:except => {:no_release => true}}"
|
|
19
|
+
error_type = ::Capistrano::CommandError
|
|
20
|
+
else
|
|
21
|
+
context_name = "vlad"
|
|
22
|
+
role_default = "[:app]"
|
|
23
|
+
error_type = ::Rake::CommandFailedError
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
roles = context.fetch(:bundle_roles, false)
|
|
27
|
+
opts[:roles] = roles if roles
|
|
28
|
+
|
|
29
|
+
context.send :namespace, :bundle do
|
|
30
|
+
send :desc, <<-DESC
|
|
31
|
+
Install the current Bundler environment. By default, gems will be \
|
|
32
|
+
installed to the shared/bundle path. Gems in the development and \
|
|
33
|
+
test group will not be installed. The install command is executed \
|
|
34
|
+
with the --deployment and --quiet flags. If the bundle cmd cannot \
|
|
35
|
+
be found then you can override the bundle_cmd variable to specify \
|
|
36
|
+
which one it should use. The base path to the app is fetched from \
|
|
37
|
+
the :latest_release variable. Set it for custom deploy layouts.
|
|
38
|
+
|
|
39
|
+
You can override any of these defaults by setting the variables shown below.
|
|
40
|
+
|
|
41
|
+
N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \
|
|
42
|
+
in your deploy.rb file.
|
|
43
|
+
|
|
44
|
+
set :bundle_gemfile, "Gemfile"
|
|
45
|
+
set :bundle_dir, File.join(fetch(:shared_path), 'bundle')
|
|
46
|
+
set :bundle_flags, "--deployment --quiet"
|
|
47
|
+
set :bundle_without, [:development, :test]
|
|
48
|
+
set :bundle_with, [:mysql]
|
|
49
|
+
set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle"
|
|
50
|
+
set :bundle_roles, #{role_default} # e.g. [:app, :batch]
|
|
51
|
+
DESC
|
|
52
|
+
send task_method, :install, opts do
|
|
53
|
+
bundle_cmd = context.fetch(:bundle_cmd, "bundle")
|
|
54
|
+
bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet")
|
|
55
|
+
bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), "bundle"))
|
|
56
|
+
bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile")
|
|
57
|
+
bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact
|
|
58
|
+
bundle_with = [*context.fetch(:bundle_with, [])].compact
|
|
59
|
+
app_path = context.fetch(:latest_release)
|
|
60
|
+
if app_path.to_s.empty?
|
|
61
|
+
raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.")
|
|
62
|
+
end
|
|
63
|
+
# Separate out flags that need to be sent to `bundle config` with Bundler 4
|
|
64
|
+
if bundle_flags.include?('--deployment')
|
|
65
|
+
bundle_flags = bundle_flags.split(/ /).grep_v('--deployment').join(' ')
|
|
66
|
+
config_settings = ['deployment true']
|
|
67
|
+
else
|
|
68
|
+
config_settings = []
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"]
|
|
72
|
+
config_settings << "path #{bundle_dir}" unless bundle_dir.to_s.empty?
|
|
73
|
+
args << bundle_flags.to_s
|
|
74
|
+
config_settings << "without #{bundle_without.join(" ")}" unless bundle_without.empty?
|
|
75
|
+
config_settings << "with #{bundle_with.join(" ")}" unless bundle_with.empty?
|
|
76
|
+
|
|
77
|
+
bundle_cmds = config_settings.collect do |settings|
|
|
78
|
+
"#{bundle_cmd} config set --local #{settings}"
|
|
79
|
+
end + ["#{bundle_cmd} install #{args.join(" ")}"]
|
|
80
|
+
run "cd #{app_path} && #{bundle_cmds.join(' && ')}"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Capistrano task for Bundler.
|
|
88
|
+
require "capistrano/version"
|
|
89
|
+
|
|
90
|
+
if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
|
91
|
+
raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
|
95
|
+
before "deploy:finalize_update", "bundle:install"
|
|
96
|
+
Bundler::Deployment.define_task(self, :task, except: { no_release: true })
|
|
97
|
+
set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
|
|
98
|
+
end
|
|
99
|
+
# rubocop:enable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
|
|
100
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'capistrano/recipes/deploy/strategy/copy'
|
|
2
|
+
|
|
3
|
+
# Do not include macOS extended attributes in capistrano tar files
|
|
4
|
+
#
|
|
5
|
+
# Without this, the system default tar (bsdtar) creates AppleDouble files with a
|
|
6
|
+
# ._ prefix, and the linux default tar (gnutar) generates many warnings such as:
|
|
7
|
+
# tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
|
|
8
|
+
#
|
|
9
|
+
# This fix works because we compress files only locally, for capistrano deployments.
|
|
10
|
+
# If we were compressing files remotely too, we would instead need to selectively
|
|
11
|
+
# redefine behaviour for local tar usage vs remote usage, e.g. by adding a
|
|
12
|
+
# :copy_local_tar_options variable, similar to :copy_local_tar
|
|
13
|
+
module CopyMacosTarSupport
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def compress(directory, file)
|
|
17
|
+
if compression.compress_command[0] == 'tar' && local_tar_is_macos_bsdtar?
|
|
18
|
+
return macos_bsdtar_compress(directory, file)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
super
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def local_tar_is_macos_bsdtar?
|
|
25
|
+
RUBY_PLATFORM =~ /darwin/ && system('tar --version | grep -q ^bsdtar')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def macos_bsdtar_compress(directory, file)
|
|
29
|
+
compression.compress_command + [file, '--no-xattr', '--no-mac-metadata', directory]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
Capistrano::Deploy::Strategy::Copy.prepend(CopyMacosTarSupport)
|
|
@@ -2,8 +2,10 @@ require 'rainbow'
|
|
|
2
2
|
|
|
3
3
|
# Discrete bits of functionality we use automatically:
|
|
4
4
|
require_relative 'assets'
|
|
5
|
+
require_relative 'bundler_deployment'
|
|
5
6
|
require_relative 'deploy_secrets'
|
|
6
7
|
require_relative 'install_ruby'
|
|
8
|
+
require_relative 'macos_bsdtar'
|
|
7
9
|
require_relative 'preinstall'
|
|
8
10
|
require_relative 'restart'
|
|
9
11
|
require_relative 'revision_logger'
|
data/ndr_dev_support.gemspec
CHANGED
|
@@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
|
|
|
44
44
|
spec.add_dependency 'show_me_the_cookies'
|
|
45
45
|
|
|
46
46
|
# CI server dependencies:
|
|
47
|
-
spec.add_dependency 'activesupport', '>=
|
|
47
|
+
spec.add_dependency 'activesupport', '>= 7.0', '< 8.2'
|
|
48
48
|
spec.add_dependency 'brakeman', '>= 4.7.1'
|
|
49
49
|
spec.add_dependency 'bundler-audit'
|
|
50
50
|
spec.add_dependency 'github-linguist'
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NCRS Development Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: pry
|
|
@@ -212,20 +211,20 @@ dependencies:
|
|
|
212
211
|
requirements:
|
|
213
212
|
- - ">="
|
|
214
213
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: '
|
|
214
|
+
version: '7.0'
|
|
216
215
|
- - "<"
|
|
217
216
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: '8.
|
|
217
|
+
version: '8.2'
|
|
219
218
|
type: :runtime
|
|
220
219
|
prerelease: false
|
|
221
220
|
version_requirements: !ruby/object:Gem::Requirement
|
|
222
221
|
requirements:
|
|
223
222
|
- - ">="
|
|
224
223
|
- !ruby/object:Gem::Version
|
|
225
|
-
version: '
|
|
224
|
+
version: '7.0'
|
|
226
225
|
- - "<"
|
|
227
226
|
- !ruby/object:Gem::Version
|
|
228
|
-
version: '8.
|
|
227
|
+
version: '8.2'
|
|
229
228
|
- !ruby/object:Gem::Dependency
|
|
230
229
|
name: brakeman
|
|
231
230
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -409,8 +408,10 @@ files:
|
|
|
409
408
|
- lib/minitest/rake_ci_plugin.rb
|
|
410
409
|
- lib/ndr_dev_support.rb
|
|
411
410
|
- lib/ndr_dev_support/capistrano/assets.rb
|
|
411
|
+
- lib/ndr_dev_support/capistrano/bundler_deployment.rb
|
|
412
412
|
- lib/ndr_dev_support/capistrano/deploy_secrets.rb
|
|
413
413
|
- lib/ndr_dev_support/capistrano/install_ruby.rb
|
|
414
|
+
- lib/ndr_dev_support/capistrano/macos_bsdtar.rb
|
|
414
415
|
- lib/ndr_dev_support/capistrano/ndr_model.rb
|
|
415
416
|
- lib/ndr_dev_support/capistrano/preinstall.rb
|
|
416
417
|
- lib/ndr_dev_support/capistrano/restart.rb
|
|
@@ -472,7 +473,6 @@ homepage: https://github.com/NHSDigital/ndr_dev_support
|
|
|
472
473
|
licenses:
|
|
473
474
|
- MIT
|
|
474
475
|
metadata: {}
|
|
475
|
-
post_install_message:
|
|
476
476
|
rdoc_options: []
|
|
477
477
|
require_paths:
|
|
478
478
|
- lib
|
|
@@ -487,8 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
487
487
|
- !ruby/object:Gem::Version
|
|
488
488
|
version: '0'
|
|
489
489
|
requirements: []
|
|
490
|
-
rubygems_version: 3.
|
|
491
|
-
signing_key:
|
|
490
|
+
rubygems_version: 3.6.9
|
|
492
491
|
specification_version: 4
|
|
493
492
|
summary: NDR Developer Support library
|
|
494
493
|
test_files: []
|