dlss-capistrano 5.1.1 → 5.3.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 +4 -4
- data/README.md +6 -4
- data/dlss-capistrano.gemspec +1 -1
- data/lib/dlss/capistrano/tasks/control_master.rake +0 -7
- data/lib/dlss/capistrano/tasks/deployed_branch.rake +1 -1
- data/lib/dlss/capistrano/tasks/remote_execute.rake +1 -1
- data/lib/dlss/capistrano/tasks/setup/setup.rake +20 -0
- data/lib/dlss/capistrano/tasks/solid_queue_systemd.rake +44 -0
- data/lib/dlss/capistrano/tasks/ssh_check.rake +1 -1
- data/lib/dlss/capistrano.rb +1 -0
- data/lib/dlss.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20ce3abcea6996c7366473874dbd9b7106749c5e7b365d21e301195ead06830
|
4
|
+
data.tar.gz: 75a94eb0b169763cd62e7dd92bcb8b183d7621e5ea271613c06b7b4814835c7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c18fc1a359d2bffa0f474b4e3eaa4d00010e01bddf6eb37dde993512c1f3076ed861b5ff79d955afa8a406d125c95feb5a9b91561a02d81561484c0e802a03b9
|
7
|
+
data.tar.gz: c03fd209a7440b754cad93ed9b671cd3554d86804c358bc7aa0b65fb2c46a99d6b518b3baab57719da1784fe42c85d03b55d5602f56a8810fbf13cb2e56a0f9b
|
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
|
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
|
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
|
|
@@ -83,6 +81,10 @@ These tasks are intended to replace those provided by `capistrano-sidekiq` gem,
|
|
83
81
|
|
84
82
|
`cap ENV sneakers_systemd:{stop,start,restart}`: stops, starts, restarts Sneakers via systemd.
|
85
83
|
|
84
|
+
### SolidQueue via systemd
|
85
|
+
|
86
|
+
`cap ENV solid_queue_systemd:{stop,start,restart}`: stops, starts, restarts SolidQueue via systemd.
|
87
|
+
|
86
88
|
### Racecar via systemd
|
87
89
|
|
88
90
|
`cap ENV racecar_systemd:{stop,start,restart}`: stops, starts, restarts Racecar via systemd.
|
data/dlss-capistrano.gemspec
CHANGED
@@ -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
|
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,
|
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
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Capistrano plugin hook to set default values
|
2
|
+
namespace :load do
|
3
|
+
task :defaults do
|
4
|
+
set :solid_queue_systemd_role, fetch(:solid_queue_systemd_role, :app)
|
5
|
+
set :solid_queue_systemd_use_hooks, fetch(:solid_queue_systemd_use_hooks, false)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# Integrate solid_queue hooks into Capistrano
|
10
|
+
namespace :deploy do
|
11
|
+
before :starting, :add_solid_queue_systemd_hooks do
|
12
|
+
invoke 'solid_queue_systemd:add_hooks' if fetch(:solid_queue_systemd_use_hooks)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
namespace :solid_queue_systemd do
|
17
|
+
# NOTE: no `desc` here to avoid publishing this task in the `cap -T` list
|
18
|
+
task :add_hooks do
|
19
|
+
after 'deploy:failed', 'solid_queue_systemd:restart'
|
20
|
+
after 'deploy:published', 'solid_queue_systemd:start'
|
21
|
+
after 'deploy:starting', 'solid_queue_systemd:stop'
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Stop running workers gracefully'
|
25
|
+
task :stop do
|
26
|
+
on roles(fetch(:solid_queue_systemd_role)) do
|
27
|
+
sudo :systemctl, 'stop', 'solid_queue'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc 'Start workers'
|
32
|
+
task :start do
|
33
|
+
on roles(fetch(:solid_queue_systemd_role)) do
|
34
|
+
sudo :systemctl, 'start', 'solid_queue'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'Restart workers'
|
39
|
+
task :restart do
|
40
|
+
on roles(fetch(:solid_queue_systemd_role)) do
|
41
|
+
sudo :systemctl, 'restart', 'solid_queue', raise_on_non_zero_exit: false
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/dlss/capistrano.rb
CHANGED
data/lib/dlss.rb
CHANGED
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.
|
4
|
+
version: 5.3.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-
|
12
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -119,8 +119,10 @@ 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
|
125
|
+
- lib/dlss/capistrano/tasks/solid_queue_systemd.rake
|
124
126
|
- lib/dlss/capistrano/tasks/ssh.rake
|
125
127
|
- lib/dlss/capistrano/tasks/ssh_check.rake
|
126
128
|
- lib/dlss/capistrano/tasks/strscan.rake
|
@@ -144,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
146
|
- !ruby/object:Gem::Version
|
145
147
|
version: 1.3.6
|
146
148
|
requirements: []
|
147
|
-
rubygems_version: 3.5.
|
149
|
+
rubygems_version: 3.5.16
|
148
150
|
signing_key:
|
149
151
|
specification_version: 4
|
150
152
|
summary: Capistrano recipes for use in SUL/DLSS projects
|