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 +4 -4
- data/README.md +2 -0
- data/dlss-capistrano.gemspec +1 -1
- data/lib/dlss/capistrano/tasks/control_master.rake +15 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf8c65ac4ab455803d2c5a0bf37a552cf4f058c6e16d40980d2e372055d949b
|
4
|
+
data.tar.gz: 80276f5cda72a4d4d126bc5ef9e1e0b80c7f4fe9483de2f8f582a4d2139b14fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/dlss-capistrano.gemspec
CHANGED
@@ -2,8 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'open3'
|
4
4
|
|
5
|
-
|
6
|
-
|
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 (#{
|
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} #{
|
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 #{
|
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 #{
|
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.
|
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-
|
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.
|
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
|