capistrano-nomad 0.9.1 → 0.9.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 +10 -7
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/dsl.rb +7 -0
- data/lib/capistrano/nomad/helpers/nomad.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '064875b4478852c18387c8084ff4b0e5c2cb4e9377a6854724f46119b416ecf5'
|
|
4
|
+
data.tar.gz: 15069bfd33db0a2b497a7e6a1adf816669df6ba0b508364fb8a26728e46ae329
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eff94039fa9b7c506fbe139670639d326423c409813c4a10c97c15e79256f4bc5f65a181a2d8608af9bdd0aa51aeaeb999ad27e02836b2af8815b961999f8470
|
|
7
|
+
data.tar.gz: 255c76c93ba40a4fd35206b31d511a7a42e2954c4e4f072154effe68643e66a938fd0aacd3f029e7e5cfa37f13f82cb924606ab4bc2fc61be92234c5e3d7428d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -102,11 +102,14 @@ 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
104
|
nomad_job :redis, docker_image_types: [:redis], tags: [:redis]
|
|
105
|
-
nomad_job :"traefik-default", template: :
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
nomad_job :"traefik-default", template: :admin,
|
|
106
|
+
erb_vars: { role: :default },
|
|
107
|
+
tags: [:traefik]
|
|
108
|
+
nomad_job :"traefik-secondary", template: :admin,
|
|
109
|
+
erb_vars: { role: :secondary },
|
|
110
|
+
tags: [:traefik]
|
|
111
|
+
|
|
112
|
+
nomad_namespace :analytics, tags: [:admin] do
|
|
110
113
|
nomad_job :grafana
|
|
111
114
|
end
|
|
112
115
|
|
|
@@ -137,9 +140,9 @@ Tasks can go by namespace or `all` namespaces, and can also be filtered by tags
|
|
|
137
140
|
cap production nomad:analytics:deploy
|
|
138
141
|
cap production nomad:analytics:upload_run
|
|
139
142
|
cap production nomad:all:deploy
|
|
140
|
-
cap production nomad:all:deploy TAG=
|
|
143
|
+
cap production nomad:all:deploy TAG=admin
|
|
141
144
|
cap production nomad:all:upload_run
|
|
142
|
-
cap production nomad:all:upload_run TAGS=
|
|
145
|
+
cap production nomad:all:upload_run TAGS=admin,redis
|
|
143
146
|
```
|
|
144
147
|
|
|
145
148
|
Open console
|
data/capistrano-nomad.gemspec
CHANGED
|
@@ -36,6 +36,13 @@ def nomad_namespace(namespace, **options, &block)
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def nomad_job(name, attributes = {})
|
|
39
|
+
attributes[:tags] ||= []
|
|
40
|
+
|
|
41
|
+
# Tags added to namespace should be added to all jobs within
|
|
42
|
+
if (nomad_namespace_options = capistrano_nomad_fetch_namespace_options(@nomad_namespace))
|
|
43
|
+
attributes[:tags] += nomad_namespace_options[:tags] || []
|
|
44
|
+
end
|
|
45
|
+
|
|
39
46
|
nomad_jobs = fetch(:nomad_jobs) || Hash.new { |h, n| h[n] = {} }
|
|
40
47
|
nomad_jobs[@nomad_namespace][name] = attributes
|
|
41
48
|
|
|
@@ -243,7 +243,7 @@ def capistrano_nomad_upload(local_path:, remote_path:, erb_vars: {})
|
|
|
243
243
|
end
|
|
244
244
|
|
|
245
245
|
def capistrano_nomad_fetch_namespace_options(namespace)
|
|
246
|
-
fetch(:nomad_namespaces)
|
|
246
|
+
fetch(:nomad_namespaces)&.dig(namespace)
|
|
247
247
|
end
|
|
248
248
|
|
|
249
249
|
def capistrano_nomad_fetch_job_options(name, *args, namespace: nil)
|