capistrano-nomad 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -4
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/nomad.rb +18 -4
- 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: aa62522fae2723d97c57456a2404393ab7a231b9a8b690662b819fc60f9670fd
|
4
|
+
data.tar.gz: 3cc2ec3994a56a70e3bf4de01d8676849661a80f42b259079461fa7b7f60e11a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13de2ccba1589cce0c24add2a284d1b1932d38fb0d2ec9f1a3ed3715167d99ca9e2b181746041b59f7a89d48113e00d0608f3dd5138fd07a288db6e6bfc019c4
|
7
|
+
data.tar.gz: f993181266c7eabe3580c8ebdb03bd39c0affe87415e77f099898d8753bb6eb6ef12463459c3a24b4de493cff09af51e6b0c13a85e7a767ec02b69b8d7e02e57
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -101,9 +101,10 @@ nomad_docker_image_type :restic,
|
|
101
101
|
nomad_job :backend, docker_image_types: [:backend], var_files: [:rails]
|
102
102
|
nomad_job :frontend
|
103
103
|
nomad_job :postgres, docker_image_types: [:postgres]
|
104
|
-
nomad_job :redis, docker_image_types: [:redis]
|
105
|
-
nomad_job :"traefik-default", template: :traefik, erb_vars: { role: :default }
|
106
|
-
nomad_job :"traefik-secondary", template: :traefik, erb_vars: { role: :secondary }
|
104
|
+
nomad_job :redis, docker_image_types: [:redis], tags: [:redis]
|
105
|
+
nomad_job :"traefik-default", template: :traefik, erb_vars: { role: :default }, tags: [:traefik]
|
106
|
+
nomad_job :"traefik-secondary", template: :traefik, erb_vars: { role: :secondary }, tags: [:traefik]
|
107
|
+
nomad_job :"traefik-tertiary", template: :traefik, erb_vars: { role: :secondary }, tags: [:traefik]
|
107
108
|
|
108
109
|
nomad_namespace :analytics do
|
109
110
|
nomad_job :grafana
|
@@ -130,7 +131,7 @@ cap production nomad:analytics:grafana:restart
|
|
130
131
|
cap production nomad:postgres:status
|
131
132
|
```
|
132
133
|
|
133
|
-
Most tasks are also available for namespace or all
|
134
|
+
Most tasks are also available for namespace or `all`
|
134
135
|
|
135
136
|
```shell
|
136
137
|
cap production nomad:analytics:deploy
|
@@ -139,6 +140,13 @@ cap production nomad:all:deploy
|
|
139
140
|
cap production nomad:all:upload_run
|
140
141
|
```
|
141
142
|
|
143
|
+
Filter by tags
|
144
|
+
|
145
|
+
```shell
|
146
|
+
cap production nomad:all:deploy tag=traefik
|
147
|
+
cap production nomad:all:upload_run tags=traefik,redis
|
148
|
+
```
|
149
|
+
|
142
150
|
Open console
|
143
151
|
|
144
152
|
```shell
|
data/capistrano-nomad.gemspec
CHANGED
@@ -255,12 +255,26 @@ def capistrano_nomad_fetch_job_var_files(name, *args)
|
|
255
255
|
end
|
256
256
|
|
257
257
|
def capistrano_nomad_fetch_jobs_names_by_namespace(namespace: :all)
|
258
|
-
|
258
|
+
# Can pass tags via command line (e.g. tag=foo or tags=foo,bar)
|
259
|
+
tags =
|
260
|
+
[ENV["tag"], ENV["tags"]].map do |tag_args|
|
261
|
+
next unless tag_args.presence
|
259
262
|
|
260
|
-
|
261
|
-
|
263
|
+
tag_args.split(",").map(&:presence).compact.map(&:to_sym)
|
264
|
+
end
|
265
|
+
.flatten
|
266
|
+
.compact
|
267
|
+
|
268
|
+
fetch(:nomad_jobs).each_with_object({}) do |(jobs_namespace, jobs_options), hash|
|
269
|
+
next if namespace != :all && namespace != jobs_namespace
|
270
|
+
|
271
|
+
hash[jobs_namespace] = jobs_options.each_with_object([]) do |(job_name, job_options), collection|
|
272
|
+
# Filter jobs by tags if specified
|
273
|
+
next if tags.any? && ((job_options[:tags]&.map(&:to_sym) || []) & tags).empty?
|
262
274
|
|
263
|
-
|
275
|
+
collection << job_name
|
276
|
+
end
|
277
|
+
end
|
264
278
|
end
|
265
279
|
|
266
280
|
def capistrano_nomad_fetch_jobs_docker_image_types(names, namespace: nil)
|
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.9.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: 2024-07-
|
11
|
+
date: 2024-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|