dlss-capistrano 5.0.0 → 5.0.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
2
  SHA256:
3
- metadata.gz: 567a3f876085fa1cdc2de7ed0d79b874ca479674a82d158a32dece1d66316a92
4
- data.tar.gz: 2cabff7242f8966857e68d05a27dfec7664192c094bbacf007b4bea605b7cab3
3
+ metadata.gz: 4bf8c65ac4ab455803d2c5a0bf37a552cf4f058c6e16d40980d2e372055d949b
4
+ data.tar.gz: 80276f5cda72a4d4d126bc5ef9e1e0b80c7f4fe9483de2f8f582a4d2139b14fc
5
5
  SHA512:
6
- metadata.gz: fca3a41b870e3b4050847bc283481a55066fc32ae36719ebed145f4771fe2ef9d70b76494bc5b44e43e372322a5f5df8dd9ee59b2c0bdefaead5a58ac2c0078d
7
- data.tar.gz: 93dfc1d74b6de88f4a9d69bcac565faa5ad4262f694dbfef1f0ca5d77ab89a2ebcd016ca4898d826cb1076d882bba879797171d587ea5e277e6c32954e23d172
6
+ metadata.gz: bad31704f2aa552e08a2361201fcc82cbb772a3f8bbd4952d46410ea1667f17227dfaf67856d8646addef27d7bf3bf6610b1c908a375336e37990e6824b74f92
7
+ data.tar.gz: 79377df1b16a760dad8a35d45101533557b98c76e704e601fce30df3c99caec950e99b28913f1d10c213f1853c707a089fe8a03f6fbd5dae62432cb79ad9939d
data/README.md CHANGED
@@ -6,6 +6,8 @@ This gem provides Capistrano deployment tasks used by Stanford Libraries' Digita
6
6
 
7
7
  ## Necessary setup
8
8
 
9
+ 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).
10
+
9
11
  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.
10
12
 
11
13
  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.
@@ -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.0.0'
7
+ s.version = '5.0.1'
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", 'Mike Giarlo']
@@ -2,8 +2,13 @@
2
2
 
3
3
  require 'open3'
4
4
 
5
- CONTROLMASTER_HOST = ENV.fetch('CONTROLMASTER_HOST', 'dlss-jump')
6
- CONTROLMASTER_SOCKET = ENV.fetch('CONTROLMASTER_SOCKET', "~/.ssh/%r@%h:%p")
5
+ namespace :load do
6
+ task :defaults do
7
+ set :use_controlmaster, ENV.fetch('USE_CAPISTRANO_CONTROLMASTER', false) == 'true'
8
+ set :controlmaster_host, ENV.fetch('CONTROLMASTER_HOST', 'dlss-jump')
9
+ set :controlmaster_socket, ENV.fetch('CONTROLMASTER_SOCKET', "~/.ssh/%r@%h:%p")
10
+ end
11
+ end
7
12
 
8
13
  # Integrate hook into Capistrano
9
14
  namespace :deploy do
@@ -15,12 +20,14 @@ end
15
20
  namespace :controlmaster do
16
21
  desc 'set up an SSH controlmaster process if missing'
17
22
  task :setup do
23
+ next unless fetch(:use_controlmaster)
24
+
18
25
  if fetch(:log_level) == :debug
19
- puts "checking if controlmaster process exists (#{CONTROLMASTER_SOCKET}) for #{CONTROLMASTER_HOST}"
26
+ puts "checking if controlmaster process exists (#{fetch(:controlmaster_socket)}) for #{fetch(:controlmaster_host)}"
20
27
  end
21
28
 
22
29
  status, output = Open3.popen2e(
23
- "ssh -O check -S #{CONTROLMASTER_SOCKET} #{CONTROLMASTER_HOST}"
30
+ "ssh -O check -S #{CONTROLMASTER_SOCKET} #{fetch(:controlmaster_host)}"
24
31
  ) { |_, outerr, wait_thr| next wait_thr.value, outerr.read }
25
32
 
26
33
  if status.success?
@@ -34,12 +41,14 @@ namespace :controlmaster do
34
41
 
35
42
  # NOTE: no `desc` here to avoid publishing this task in the `cap -T` list
36
43
  task :start do
44
+ next unless fetch(:use_controlmaster)
45
+
37
46
  if fetch(:log_level) == :debug
38
- puts "creating new controlmaster process for #{CONTROLMASTER_HOST} at #{CONTROLMASTER_SOCKET}"
47
+ puts "creating new controlmaster process for #{fetch(:controlmaster_host)} at #{fetch(:controlmaster_socket)}"
39
48
  end
40
49
 
41
50
  status, output = Open3.popen2e(
42
- "ssh -f -N -S #{CONTROLMASTER_SOCKET} #{CONTROLMASTER_HOST}"
51
+ "ssh -f -N -S #{fetch(:controlmaster_socket)} #{fetch(:controlmaster_host)}"
43
52
  ) { |_, outerr, wait_thr| next wait_thr.value, outerr.read }
44
53
 
45
54
  if status.success?
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.0.0
4
+ version: 5.0.1
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-14 00:00:00.000000000 Z
12
+ date: 2024-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: 1.3.6
146
146
  requirements: []
147
- rubygems_version: 3.5.11
147
+ rubygems_version: 3.5.9
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Capistrano recipes for use in SUL/DLSS projects