dlss-capistrano 4.0.0 → 4.1.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: 931006fc1c1c2b1bd0edad5c66284a68646ded0b1eb86977a9f456f5967d0aa1
4
- data.tar.gz: 7d9be758e297514f2783c09ead222dd3a5ff56cdb7832a98c2582c4774583660
3
+ metadata.gz: 1702874c90a70b558db39872139922c1bc1f513813925c50c378cf3eac575f24
4
+ data.tar.gz: 1a4c30ef36c1ccf64c9883bd0b0cced6aee568958db25d74160c1d7e71ed025d
5
5
  SHA512:
6
- metadata.gz: 8455409ed588234cb13623dd80231a6dfb8976f1d17a2de2c46086f7327d5616920fd4b3724d7d928dc4bdf0dbe0ffc3ec88668177c94c85f886ee047dc69a16
7
- data.tar.gz: 1a7e14b5f5e83dba8b59f85f22074e76b4298a8e43756dc4b6fe57e9de9639c89d60c7f9a4bf15a6ae17043bf6690640b1d4be3d9bea87754433b284276dce33
6
+ metadata.gz: b9ab79dc66765e0c794966b6e6969d060d8c3f8de8b9bcac19c659f0630da6a85b5ae8b474257f98fb71313ed103938dd2d1dbdb736ca34b15e421be928f5fc7
7
+ data.tar.gz: 427abdeb794947a38336829bcd5cd3ad9b7bc5b64f0e262f98cfc52bdc4485196a3fdfa74a30fe91150ba63fa856034dfc307fc6c87a39e433134d2e289540c5
data/README.md CHANGED
@@ -32,6 +32,19 @@ set :bundled_sidekiq_roles, [:app] # this is the default value
32
32
 
33
33
  Set this in `config/deploy.rb` to automate the symlink creation, and then use `XSendFilePath /path/to/my/app/shared/bundled_sidekiq/web/assets` in Apache configuration (in Puppet).
34
34
 
35
+ ### Status checking
36
+
37
+ **NOTE**: Requires that `curl` is installed on each server host the check is run on.
38
+
39
+ Use `cap ENV check_status` to hit the (*e.g.*, [okcomputer](https://github.com/sportngin/okcomputer)-based) status endpoint of your application. This is especially valuable with hosts that cannot be directly checked due to firewall rules.
40
+
41
+ By default, these checks run against all nodes with the `:web` role and hit the `/status/all` endpoint. These can be configured in `config/deploy.rb` (or `config/deploy/{ENV}.rb` if you need environment-specific variation):
42
+
43
+ ```ruby
44
+ set :check_status_roles, [:my_status_check_web_role]
45
+ set :check_status_path, '/my/status/check/endpoint'
46
+ ```
47
+
35
48
  ### SSH
36
49
 
37
50
  `cap ENV ssh` establishes an SSH connection to the host running in `ENV` environment, and changes into the current deployment directory
@@ -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 = '4.0.0'
7
+ s.version = '4.1.0'
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", 'Mike Giarlo']
@@ -0,0 +1,23 @@
1
+ # Capistrano plugin hook to set default values
2
+ namespace :load do
3
+ task :defaults do
4
+ set :check_status_roles, fetch(:check_status_roles, [:web])
5
+ set :check_status_path, fetch(:check_status_path, '/status/all')
6
+ end
7
+ end
8
+
9
+ desc 'Run status checks'
10
+ task :check_status do
11
+ on roles fetch(:check_status_roles), in: :sequence do |host|
12
+ status_url = "https://#{host}#{fetch(:check_status_path)}"
13
+
14
+ info "Checking status at #{status_url}"
15
+ status_body = capture("curl #{status_url}")
16
+
17
+ if status_body.match?(/FAILED/)
18
+ error status_body.lines.grep(/FAILED/).join
19
+ else
20
+ info SSHKit::Color.new($stdout).colorize('All checks passed!', :green)
21
+ end
22
+ end
23
+ 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: 4.0.0
4
+ version: 4.1.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: 2022-02-22 00:00:00.000000000 Z
12
+ date: 2022-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -88,6 +88,7 @@ files:
88
88
  - lib/dlss/capistrano/resque_pool.rb
89
89
  - lib/dlss/capistrano/resque_pool/tasks/resque_pool.rake
90
90
  - lib/dlss/capistrano/tasks/bundled_sidekiq.rake
91
+ - lib/dlss/capistrano/tasks/check_status.rake
91
92
  - lib/dlss/capistrano/tasks/deployed_branch.rake
92
93
  - lib/dlss/capistrano/tasks/remote_execute.rake
93
94
  - lib/dlss/capistrano/tasks/sidekiq_systemd.rake
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  - !ruby/object:Gem::Version
115
116
  version: 1.3.6
116
117
  requirements: []
117
- rubygems_version: 3.1.4
118
+ rubygems_version: 3.2.32
118
119
  signing_key:
119
120
  specification_version: 4
120
121
  summary: Capistrano recipes for use in SUL/DLSS projects