capistrano-nomad 0.10.0 → 0.10.1
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/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/nomad.rb +11 -11
- data/lib/capistrano/nomad/tasks/nomad.rake +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: 76af53f1a2764deb4b91363674b6627d7b6017a30609e067d42b66cdbd5c9fc0
|
4
|
+
data.tar.gz: 64825bb8a9bdccf833f23cb36aeb10cba6f516bbac8e6690193eb1674339fb94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d359a15febd84d1303360f8d9c51faf026fa6388cf6a8b97edc7fa99cee59007c4999d040935bad0351ad1fa3bc1aca5908819b1cd1fc302d711b09a7d3a42e6
|
7
|
+
data.tar.gz: 5bf77756a9d1dc2bc28ded978f0523fff65059932154c1930545dd4b06930012d45ed646108f593802e606559b2aa4c2cae867f2012bef83245308b30d1a52dd
|
data/Gemfile.lock
CHANGED
data/capistrano-nomad.gemspec
CHANGED
@@ -29,7 +29,7 @@ def capistrano_nomad_ensure_absolute_path(path)
|
|
29
29
|
path[0] == "/" ? path : "/#{path}"
|
30
30
|
end
|
31
31
|
|
32
|
-
def capistrano_nomad_build_file_path(parent_path, basename, kind: nil, namespace:
|
32
|
+
def capistrano_nomad_build_file_path(parent_path, basename, kind: nil, namespace: :default)
|
33
33
|
segments = [parent_path]
|
34
34
|
|
35
35
|
if namespace
|
@@ -132,7 +132,7 @@ def capistrano_nomad_capture_nomad_command(*args)
|
|
132
132
|
output
|
133
133
|
end
|
134
134
|
|
135
|
-
def capistrano_nomad_find_job_task_details(name, namespace:
|
135
|
+
def capistrano_nomad_find_job_task_details(name, namespace: :default, task: nil)
|
136
136
|
task = task.presence || name
|
137
137
|
|
138
138
|
# Find alloc id that contains task
|
@@ -170,7 +170,7 @@ def capistrano_nomad_find_job_task_details(name, namespace: nil, task: nil)
|
|
170
170
|
}
|
171
171
|
end
|
172
172
|
|
173
|
-
def capistrano_nomad_exec_within_job(name, command, namespace:
|
173
|
+
def capistrano_nomad_exec_within_job(name, command, namespace: :default, task: nil)
|
174
174
|
capistrano_nomad_run_remotely do
|
175
175
|
if (task_details = capistrano_nomad_find_job_task_details(name, namespace: namespace, task: task))
|
176
176
|
capistrano_nomad_execute_nomad_command(
|
@@ -246,7 +246,7 @@ def capistrano_nomad_fetch_namespace_options(namespace)
|
|
246
246
|
fetch(:nomad_namespaces)&.dig(namespace)
|
247
247
|
end
|
248
248
|
|
249
|
-
def capistrano_nomad_fetch_job_options(name, *args, namespace:
|
249
|
+
def capistrano_nomad_fetch_job_options(name, *args, namespace: :default)
|
250
250
|
fetch(:nomad_jobs).dig(namespace, name.to_sym, *args)
|
251
251
|
end
|
252
252
|
|
@@ -254,7 +254,7 @@ def capistrano_nomad_fetch_job_var_files(name, *args)
|
|
254
254
|
capistrano_nomad_fetch_job_options(name, :var_files, *args) || []
|
255
255
|
end
|
256
256
|
|
257
|
-
def capistrano_nomad_fetch_jobs_names_by_namespace(namespace:
|
257
|
+
def capistrano_nomad_fetch_jobs_names_by_namespace(namespace: :default)
|
258
258
|
# Can pass tags via command line (e.g. TAG=foo or TAGS=foo,bar)
|
259
259
|
tags =
|
260
260
|
[ENV["TAG"], ENV["TAGS"]].map do |tag_args|
|
@@ -277,11 +277,11 @@ def capistrano_nomad_fetch_jobs_names_by_namespace(namespace: nil)
|
|
277
277
|
end
|
278
278
|
end
|
279
279
|
|
280
|
-
def capistrano_nomad_fetch_jobs_docker_image_types(names, namespace:
|
280
|
+
def capistrano_nomad_fetch_jobs_docker_image_types(names, namespace: :default)
|
281
281
|
names.map { |n| fetch(:nomad_jobs).dig(namespace, n.to_sym, :docker_image_types) }.flatten.compact.uniq
|
282
282
|
end
|
283
283
|
|
284
|
-
def capistrano_nomad_define_group_tasks(namespace:
|
284
|
+
def capistrano_nomad_define_group_tasks(namespace:)
|
285
285
|
define_tasks = lambda do |nomad_namespace: nil|
|
286
286
|
desc "Build #{nomad_namespace} job Docker images"
|
287
287
|
task :build do
|
@@ -429,7 +429,7 @@ def capistrano_nomad_plan_jobs(names, *args)
|
|
429
429
|
end
|
430
430
|
end
|
431
431
|
|
432
|
-
def capistrano_nomad_run_jobs(names, namespace:
|
432
|
+
def capistrano_nomad_run_jobs(names, namespace: :default, is_detached: true)
|
433
433
|
names.each do |name|
|
434
434
|
run_options = {
|
435
435
|
namespace: namespace,
|
@@ -501,7 +501,7 @@ def capistrano_nomad_stop_jobs(names, **options)
|
|
501
501
|
end
|
502
502
|
end
|
503
503
|
|
504
|
-
def capistrano_nomad_purge_jobs(names, namespace:
|
504
|
+
def capistrano_nomad_purge_jobs(names, namespace: :default, is_detached: true)
|
505
505
|
names.each do |name|
|
506
506
|
capistrano_nomad_execute_nomad_command(:stop, { namespace: namespace, purge: true, detach: is_detached }, name)
|
507
507
|
end
|
@@ -511,7 +511,7 @@ def capistrano_nomad_display_job_status(name, **options)
|
|
511
511
|
capistrano_nomad_execute_nomad_command(:status, options, name)
|
512
512
|
end
|
513
513
|
|
514
|
-
def capistrano_nomad_display_job_logs(name, namespace:
|
514
|
+
def capistrano_nomad_display_job_logs(name, namespace: :default, **options)
|
515
515
|
if (task_details = capistrano_nomad_find_job_task_details(name, namespace: namespace, task: ENV["TASK"]))
|
516
516
|
capistrano_nomad_execute_nomad_command(
|
517
517
|
:alloc,
|
@@ -534,7 +534,7 @@ def capistrano_nomad_tail_job_logs(*args, **options)
|
|
534
534
|
capistrano_nomad_display_job_logs(*args, **options.merge(tail: true, n: 50))
|
535
535
|
end
|
536
536
|
|
537
|
-
def capistrano_nomad_open_job_ui(name, namespace:
|
537
|
+
def capistrano_nomad_open_job_ui(name, namespace: :default)
|
538
538
|
run_locally do
|
539
539
|
url = "#{fetch(:nomad_ui_url)}/ui/jobs/#{name}"
|
540
540
|
url += "@#{namespace}" if namespace
|