dlss-capistrano 5.1.1 → 5.2.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
2
  SHA256:
3
- metadata.gz: f69b0b30f58f3313e59a5fc7cf0d510d5c95d99fe5e077a772588e6ffdccbbd9
4
- data.tar.gz: e0020c24765ddd757ee839371f962325900b147aa69a399c7ad97eb60b7babb8
3
+ metadata.gz: 506c54e0736ba7c8d957d70eac27e0c87afac59efaf6661474d583633324af17
4
+ data.tar.gz: 467a54901a05725308adf64eacd926c6bee8788daa9c6c779ef053e178e51f8a
5
5
  SHA512:
6
- metadata.gz: 9e14e482febdd209f99802e0b4b0ac6323825da0312c6e50c21e97a51746fe651c8825691a9b0d86576b5239c7ba8328113c9df18565cc82a542d5cb158e0ba4
7
- data.tar.gz: ddbc21daf2f1e259764d1257a741a9fb8208e8731e693c40daf9d15c49dfb6747615ce1161ce98f34e7757ae7eacd7cce5c09c3ccfde4c9c81b8cb654f5ad837
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.1'
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', 'otk:generate'] 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', 'otk:generate'] 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', 'otk:generate'] 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.1
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