dlss-capistrano 3.10.1 → 3.11.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: 59f3e0a3a28fd4c039e6e2a861b16603911fe806ad71ca1aee18ffedb6e17ef9
4
- data.tar.gz: c272545718a09a47b2cc2cd523edc55a6cd43c6b71453d390a14da1464d756d5
3
+ metadata.gz: 80eb28bbf5c58cf57b561882ef7a7f3cffed327710fb733ac0a4450fa275fd15
4
+ data.tar.gz: a3ae9e2feb13dd590e599a786ed7cbe2e1453ffae78124b7026eef45c1ae53b9
5
5
  SHA512:
6
- metadata.gz: 5cbb9b707d0ff42c95c15e97f08a70bfd02a19cdc7fda35ca112571c907e911e43a1451a8ca3cccebe902db757fa5f4a6f31fc86fd63ef5976cf8047a525021e
7
- data.tar.gz: a9b908df522ad9696ca5b99b9235c77016fc3eaf9c7665fba277c5b3f48bb4ccf964c9c7c696339cbd204b99245587713e75fc8af24913a5c72d9732de14408e
6
+ metadata.gz: 8f13360fdbe742cf471edab521728b79a2f685fb4e98182875b951b29d65d42487cb0ccc79fd589afff5f5226d100774ff9438c25c5a724fe54ac38e6214bab8
7
+ data.tar.gz: 1eb046a6aca94b7d5e5ede77d06624d601dcb9548d4648bae559cb404fc4932e5d9564f0e600d352766e9a114362a0ff52632c9ffc478727efbc8ef6a9c81b89
data/README.md CHANGED
@@ -70,6 +70,11 @@ after 'deploy:publishing', 'resque:pool:hot_swap'
70
70
 
71
71
  These tasks are intended to replace those provided by `capistrano-sidekiq` gem, which has assumptions about systemd that do not apply to our deployed environments.
72
72
 
73
+ ### Sneakers via systemd
74
+
75
+ `cap ENV sneakers_systemd:{quiet,stop,start,restart}`: quiets, stops, starts, restarts Sneakers via systemd.
76
+
77
+
73
78
  #### Capistrano role
74
79
 
75
80
  The sidekiq_systemd tasks assume a Capistrano role of `:app`. If your application uses a different Capistrano role for hosts that run Sidekiq workers, you can configure this in `config/deploy.rb`, *e.g.*:
@@ -105,7 +110,6 @@ dlss-capistrano makes the following assumptions about your Ruby project
105
110
  - You do not have an .rvmrc checked into git (should be in your .gitignore)
106
111
  - You will not use rvm gemsets on the server you deploy to
107
112
  - Bundler will install specified gems into {your_project_home}/shared/bundle directory
108
- - Will deploy from the master branch, unless you set :branch to another branch or tag
109
113
 
110
114
  ## Copyright
111
115
 
@@ -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 = "3.10.1"
7
+ s.version = '3.11.0'
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", 'Mike Giarlo']
@@ -0,0 +1,52 @@
1
+ # Capistrano plugin hook to set default values
2
+ namespace :load do
3
+ task :defaults do
4
+ set :sneakers_systemd_role, fetch(:sneakers_systemd_role, :app)
5
+ set :sneakers_systemd_use_hooks, fetch(:sneakers_systemd_use_hooks, false)
6
+ end
7
+ end
8
+
9
+ # Integrate sneakers hooks into Capistrano
10
+ namespace :deploy do
11
+ before :starting, :add_sneakers_systemd_hooks do
12
+ invoke 'sneakers_systemd:add_hooks' if fetch(:sneakers_systemd_use_hooks)
13
+ end
14
+ end
15
+
16
+ namespace :sneakers_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', 'sneakers_systemd:restart'
20
+ after 'deploy:published', 'sneakers_systemd:start'
21
+ after 'deploy:starting', 'sneakers_systemd:quiet'
22
+ after 'deploy:updated', 'sneakers_systemd:stop'
23
+ end
24
+
25
+ desc 'Stop workers from picking up new jobs'
26
+ task :quiet do
27
+ on roles fetch(:sneakers_systemd_role) do
28
+ sudo :systemctl, 'reload', 'sneakers', raise_on_non_zero_exit: false
29
+ end
30
+ end
31
+
32
+ desc 'Stop running workers gracefully'
33
+ task :stop do
34
+ on roles fetch(:sneakers_systemd_role) do
35
+ sudo :systemctl, 'stop', 'sneakers'
36
+ end
37
+ end
38
+
39
+ desc 'Start workers'
40
+ task :start do
41
+ on roles fetch(:sneakers_systemd_role) do
42
+ sudo :systemctl, 'start', 'sneakers'
43
+ end
44
+ end
45
+
46
+ desc 'Restart workers'
47
+ task :restart do
48
+ on roles fetch(:sneakers_systemd_role) do
49
+ sudo :systemctl, 'restart', 'sneakers', raise_on_non_zero_exit: false
50
+ end
51
+ end
52
+ 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: 3.10.1
4
+ version: 3.11.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: 2020-10-28 00:00:00.000000000 Z
12
+ date: 2021-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -91,6 +91,7 @@ files:
91
91
  - lib/dlss/capistrano/tasks/bundled_sidekiq.rake
92
92
  - lib/dlss/capistrano/tasks/deployed_branch.rake
93
93
  - lib/dlss/capistrano/tasks/sidekiq_systemd.rake
94
+ - lib/dlss/capistrano/tasks/sneakers_systemd.rake
94
95
  - lib/dlss/capistrano/tasks/ssh.rake
95
96
  - lib/dlss/capistrano/tasks/ssh_check.rake
96
97
  - lib/lyberteam-capistrano-devel.rb
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
114
  - !ruby/object:Gem::Version
114
115
  version: 1.3.6
115
116
  requirements: []
116
- rubygems_version: 3.1.2
117
+ rubygems_version: 3.1.4
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: Capistrano recipes for use in SUL/DLSS projects