capistrano-nomad 0.12.2 → 0.13.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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -2
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/dsl.rb +2 -1
- data/lib/capistrano/nomad/helpers/nomad.rb +11 -2
- 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: 3e7e38b148a42c46f1dcb205584740556e289d962964e1e48c767f1dd67e1366
|
4
|
+
data.tar.gz: 015bb5b73e8e3d20f0ad79eb4275d7f99cb6bcfe3fd2121ec9cfb43b264325c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f1872dfe2feaf419611b6a7f5b5063d24101b97755b5b46d28377aa86101b686d5f497c7bdca9c9fabcdcb41313474acdb0c0f40f5d91073cc581e99170d069
|
7
|
+
data.tar.gz: 7683489fae1bafb6cb6b7b982a0ac32941923551949666d89be5bccdfad22ea20d176d1ca8ea95cb1482ccca1c0dcd5e2f1b1208613fa8a11f0a3cdb44af3cbf
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -37,6 +37,9 @@ Within `deploy.rb`
|
|
37
37
|
set :nomad_jobs_path, "nomad/jobs"
|
38
38
|
set :nomad_var_files_path, "nomad/vars"
|
39
39
|
|
40
|
+
# Set token
|
41
|
+
set :nomad_token, "abc123"
|
42
|
+
|
40
43
|
# Determines base URL to use when opening job in web UI
|
41
44
|
set :nomad_ui_url, "http://localhost:4646"
|
42
45
|
|
@@ -99,7 +102,7 @@ nomad_docker_image_type :restic,
|
|
99
102
|
|
100
103
|
# Jobs
|
101
104
|
nomad_job :backend, docker_image_types: [:backend], var_files: [:rails]
|
102
|
-
nomad_job :frontend
|
105
|
+
nomad_job :frontend, console_command: "/bin/bash"
|
103
106
|
nomad_job :postgres, docker_image_types: [:postgres]
|
104
107
|
nomad_job :redis, docker_image_types: [:redis], tags: [:redis]
|
105
108
|
nomad_job :"traefik-default", template: :admin,
|
@@ -150,7 +153,7 @@ Open console
|
|
150
153
|
```shell
|
151
154
|
cap production nomad:app:console
|
152
155
|
cap production nomad:app:console TASK=custom-task-name
|
153
|
-
cap production nomad:analytics:grafana:console
|
156
|
+
cap production nomad:analytics:grafana:console CMD=/bin/bash
|
154
157
|
```
|
155
158
|
|
156
159
|
Display logs
|
@@ -182,6 +185,12 @@ Create missing and delete unused namespaces
|
|
182
185
|
cap production nomad:modify_namespaces
|
183
186
|
```
|
184
187
|
|
188
|
+
Show version
|
189
|
+
|
190
|
+
```shell
|
191
|
+
cap production nomad:version
|
192
|
+
```
|
193
|
+
|
185
194
|
## Development
|
186
195
|
|
187
196
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/capistrano-nomad.gemspec
CHANGED
@@ -141,7 +141,8 @@ def nomad_job(name, attributes = {})
|
|
141
141
|
|
142
142
|
desc("Open console to #{description_name} job. Specify task with TASK, command with CMD")
|
143
143
|
task(:console) do
|
144
|
-
|
144
|
+
job_options = capistrano_nomad_fetch_job_options(name, namespace: namespace)
|
145
|
+
command = ENV["COMMAND"].presence || ENV["CMD"].presence || job_options[:console_command] || "/bin/sh"
|
145
146
|
|
146
147
|
capistrano_nomad_exec_within_job(name, command, namespace: namespace, task: ENV["TASK"])
|
147
148
|
end
|
@@ -112,8 +112,17 @@ def capistrano_nomad_run_nomad_command(kind, *args)
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
|
116
|
-
|
115
|
+
env_vars = {}
|
116
|
+
|
117
|
+
# Pass Nomad token as environment variable if set
|
118
|
+
if (nomad_token = fetch(:nomad_token))
|
119
|
+
env_vars[:nomad_token] = nomad_token
|
120
|
+
end
|
121
|
+
|
122
|
+
with(env_vars) do
|
123
|
+
# Ignore errors
|
124
|
+
public_send(kind, :nomad, *converted_args, raise_on_non_zero_exit: false)
|
125
|
+
end
|
117
126
|
end
|
118
127
|
|
119
128
|
def capistrano_nomad_execute_nomad_command(*args, **options)
|
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.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Hu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|