capistrano-nomad 0.6.1 → 0.6.2
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/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/dsl.rb +1 -18
- data/lib/capistrano/nomad/helpers/nomad.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25b29aaa6c532b6656df34b6ebc7ebc23359c4acb3ae2b8c5d7320a2e79c7f66
|
|
4
|
+
data.tar.gz: 770838795fb494f1c4305168d6b60f51be7f1d33bec9c31e45b7d119ecd427f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24cd34d64db04c41e6b2e39ced4e84129e4fb3ff2d70a25e53d945e2bcdaf35e7a45f6783c1e5cd37d061053ba24b2717d939f6b3e0cd0939c14bc8f39def70d
|
|
7
|
+
data.tar.gz: e978fbbf7205ed2d160e2702ae9109ba73722c695f9de2e0c8f51cc010a248da5ffbed583d452e1bcc7a6e0ee22989202afd183430256ae73cc7f0f4515d83fa
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -60,10 +60,11 @@ nomad_docker_image_type :redis,
|
|
|
60
60
|
nomad_job :frontend
|
|
61
61
|
nomad_job :backend, docker_image_types: [:backend], var_files: [:rails]
|
|
62
62
|
nomad_job :redis, docker_image_types: [:redis]
|
|
63
|
+
nomad_job :"traefik-default", template: :traefik, erb_vars: { role: :default }
|
|
64
|
+
nomad_job :"traefik-secondary", template: :traefik, erb_vars: { role: :secondary }
|
|
63
65
|
|
|
64
66
|
nomad_namespace :analytics do
|
|
65
67
|
nomad_job :grafana
|
|
66
|
-
nomad_job :"node-exporter"
|
|
67
68
|
end
|
|
68
69
|
```
|
|
69
70
|
|
data/capistrano-nomad.gemspec
CHANGED
|
@@ -90,24 +90,7 @@ def nomad_job(name, attributes = {})
|
|
|
90
90
|
|
|
91
91
|
desc "Restart #{description_name} job"
|
|
92
92
|
task :restart do
|
|
93
|
-
|
|
94
|
-
# We can't restart the job directly so we'll need to fetch all its running allocs and restart each of one
|
|
95
|
-
# individually instead
|
|
96
|
-
running_alloc_ids_output = capistrano_nomad_capture_nomad_command(
|
|
97
|
-
:job,
|
|
98
|
-
:allocs,
|
|
99
|
-
{
|
|
100
|
-
namespace: namespace,
|
|
101
|
-
t: "'{{range .}}{{if eq .ClientStatus \"running\"}}{{ println .ID}}{{end}}{{end}}'",
|
|
102
|
-
},
|
|
103
|
-
name,
|
|
104
|
-
)
|
|
105
|
-
running_alloc_ids = running_alloc_ids_output.strip.split("\n")
|
|
106
|
-
|
|
107
|
-
running_alloc_ids.each do |alloc_id|
|
|
108
|
-
capistrano_nomad_execute_nomad_command(:alloc, :restart, alloc_id)
|
|
109
|
-
end
|
|
110
|
-
end
|
|
93
|
+
capistrano_nomad_restart_jobs([name], namespace: namespace)
|
|
111
94
|
end
|
|
112
95
|
|
|
113
96
|
desc "Open console to #{description_name} job. Specify task by passing TASK environment variable"
|
|
@@ -321,6 +321,12 @@ def capistrano_nomad_deploy_jobs(names, *args)
|
|
|
321
321
|
capistrano_nomad_upload_run_jobs(names, *args)
|
|
322
322
|
end
|
|
323
323
|
|
|
324
|
+
def capistrano_nomad_restart_jobs(names, namespace: nil)
|
|
325
|
+
names.each do |name|
|
|
326
|
+
capistrano_nomad_execute_nomad_command(:job, :restart, { namespace: namespace }, name)
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
|
|
324
330
|
def capistrano_nomad_purge_jobs(names, namespace: nil, is_detached: true)
|
|
325
331
|
names.each do |name|
|
|
326
332
|
capistrano_nomad_execute_nomad_command(:stop, { namespace: namespace, purge: true, detach: is_detached }, name)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-nomad
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Hu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-10-
|
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|