dlss-capistrano 5.1.0 → 5.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7171cbf97175278c409ee689dfffe6e913aecffbcbafbfa2b1c4cb17a4ac1d6e
4
- data.tar.gz: d8fdf63e606d14426b68111e8b24540faabf078fa12dee7dfaf728c5af1a2629
3
+ metadata.gz: 506c54e0736ba7c8d957d70eac27e0c87afac59efaf6661474d583633324af17
4
+ data.tar.gz: 467a54901a05725308adf64eacd926c6bee8788daa9c6c779ef053e178e51f8a
5
5
  SHA512:
6
- metadata.gz: f5124eadc4d97921d2e77cc544e24c3f21e2d8ebc116bf8914ed8e7850d0fc836eed2d960c18bf57c9a1e8294a8af1a8841634fabc9f811e1cd8cd7c2419b630
7
- data.tar.gz: b764c9e4e9946ed1a9cffe5628b470cfd4259248e715f60c6f46142a2f109990bd7df880b9051f2496ca7664d03a29a6d4bc7f4264b4a98db4ccea44ed406a0a
6
+ metadata.gz: 21c6a06bf65ea3a5df664de92e72c4030dce9bd281834863eda9205f4e2fa96b49753c2a5f8b36efec1f72fcfaef9ba559e3513f9efe09212e1584f7c25c7d57
7
+ data.tar.gz: 961902bb30a3e69e262ef12f140bf34fdee71d32c8f79eb9c3949ddcd32fa6f9c7160b52b349b7114f7535245b8420d61a7ec41e25afec98414f59000f55afe7
data/README.md CHANGED
@@ -8,11 +8,9 @@ This gem provides Capistrano deployment tasks used by Stanford Libraries' Digita
8
8
 
9
9
  To start, we recommend an SSH configuration like the one described in the [DeveloperPlaybook](https://github.com/sul-dlss/DeveloperPlaybook/blob/main/best-practices/ssh_configuration.md), since it has sensible defaults for Kerberos authentication and multi-factor authentication (using `ProxyJump` and `ControlMaster`, etc.).
10
10
 
11
- To use controlmaster, you need to opt-in by setting the environment variable `USE_CAPISTRANO_CONTROLMASTER=true` (in e.g. your `~/.zshenv` file or similar for your particular shell).
11
+ To get `dlss-capistrano` tasks running via an existing SSH control master socket, you need to opt-in by setting the environment variable `USE_CAPISTRANO_CONTROLMASTER=true` (in e.g. your `~/.zshenv` file or similar for your particular shell).
12
12
 
13
- If you use values other than the defaults for `CONTROLMASTER_HOST` (`dlss-jump`) or `CONTROLMASTER_SOCKET` (`"~/.ssh/%r@%h:%p"`), you'll want to set these environment variables locally to the values you use (in e.g. your `~/.zshenv` file or similar for your particular shell). Otherwise, the gem will fail to connect to the appropriate host and/or won't be able to properly check the status of the control master process.
14
-
15
- The control master host is the value of the `ProxyJump` directive in your SSH config, and the control master socket is the value of the `ControlPath` directive in your SSH config.
13
+ If your SSH client configuration (`~/.ssh/config`) uses values other than the defaults for `CONTROLMASTER_HOST` (which maps to the `ProxyJump` directive, and defaults to `dlss-jump`) or `CONTROLMASTER_SOCKET` (which maps to the `ControlPath` directive, and defaults to `~/.ssh/%r@%h:%p`), you'll want to set these environment variables locally to the values you use (in e.g. your `~/.zshenv` file or similar for your particular shell). Otherwise, the gem will fail to connect to the appropriate jump host and/or won't be able to properly check the status of the control master process.
16
14
 
17
15
  ## Included Tasks
18
16
 
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "dlss-capistrano"
7
- s.version = '5.1.0'
7
+ s.version = '5.2.0'
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", 'Mike Giarlo']
@@ -10,13 +10,6 @@ namespace :load do
10
10
  end
11
11
  end
12
12
 
13
- # Integrate hook into Capistrano
14
- namespace :deploy do
15
- before :generate_otk, :setup_controlmaster do
16
- invoke 'controlmaster:setup'
17
- end
18
- end
19
-
20
13
  namespace :controlmaster do
21
14
  desc 'set up an SSH controlmaster process if missing'
22
15
  task :setup do
@@ -1,5 +1,5 @@
1
1
  desc 'display the deployed branch and commit'
2
- task deployed_branch: 'controlmaster:setup' do
2
+ task :deployed_branch do
3
3
  # see https://github.com/mattbrictson/airbrussh/tree/v1.5.2?tab=readme-ov-file#capistrano-34x
4
4
  Airbrussh.configure do |config|
5
5
  config.truncate = false
@@ -10,7 +10,7 @@ namespace :load do
10
10
  end
11
11
 
12
12
  desc "execute command on all servers"
13
- task :remote_execute, [:command] => 'controlmaster:setup' do |_task, args|
13
+ task :remote_execute, :command do |_task, args|
14
14
  raise ArgumentError, 'remote_execute task requires an argument' unless args[:command]
15
15
 
16
16
  # see https://github.com/mattbrictson/airbrussh/tree/v1.5.2?tab=readme-ov-file#capistrano-34x
@@ -0,0 +1,20 @@
1
+ # Setup controlmaster SSH session before generating one-time-key
2
+ before 'otk:generate', 'controlmaster:setup'
3
+
4
+ DOES_NOT_REQUIRE_OTK_LIST = [
5
+ 'bundler:map_bins',
6
+ 'controlmaster:setup',
7
+ 'controlmaster:start',
8
+ 'default',
9
+ 'deploy:generate_otk',
10
+ 'install',
11
+ 'load:defaults',
12
+ 'otk:generate',
13
+ *Rake.application.stages
14
+ ].freeze
15
+
16
+ Rake.application.tasks.each do |task|
17
+ next if DOES_NOT_REQUIRE_OTK_LIST.include?(task.name)
18
+
19
+ before task, 'deploy:generate_otk'
20
+ end
@@ -1,5 +1,5 @@
1
1
  desc "check ssh connections to all app servers"
2
- task ssh_check: 'controlmaster:setup' do
2
+ task :ssh_check do
3
3
  on roles(:app), in: :sequence do
4
4
  execute
5
5
  end
@@ -3,3 +3,4 @@ require 'capistrano/bundle_audit'
3
3
  require 'capistrano/shared_configs'
4
4
 
5
5
  Dir.glob("#{__dir__}/capistrano/tasks/*.rake").each { |r| import r }
6
+ Dir.glob("#{__dir__}/capistrano/tasks/setup/*.rake").each { |r| import r }
data/lib/dlss.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DLSS
2
2
  require 'dlss/capistrano'
3
- end
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dlss-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-06-18 00:00:00.000000000 Z
12
+ date: 2024-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -119,6 +119,7 @@ files:
119
119
  - lib/dlss/capistrano/tasks/deployed_branch.rake
120
120
  - lib/dlss/capistrano/tasks/racecar_systemd.rake
121
121
  - lib/dlss/capistrano/tasks/remote_execute.rake
122
+ - lib/dlss/capistrano/tasks/setup/setup.rake
122
123
  - lib/dlss/capistrano/tasks/sidekiq_systemd.rake
123
124
  - lib/dlss/capistrano/tasks/sneakers_systemd.rake
124
125
  - lib/dlss/capistrano/tasks/ssh.rake
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
145
  - !ruby/object:Gem::Version
145
146
  version: 1.3.6
146
147
  requirements: []
147
- rubygems_version: 3.5.11
148
+ rubygems_version: 3.5.15
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: Capistrano recipes for use in SUL/DLSS projects