capistrano-nomad 0.10.3 → 0.10.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e53ea71739d8bf0e6a35acc8fc6cf53b38793e2cb84406eabcbcae39eb3c95a
4
- data.tar.gz: 9acd6a38e395394f5b6fd2c29b7f79ff57ab4b5f03580b507131f4f14fa0e73c
3
+ metadata.gz: 044045d89fd983a7ecbc98532843a5fbaf28e18b48661338a41bc91279454341
4
+ data.tar.gz: 4895faeb0b7e75aeb6d2e9cddd17e4509c6d60d76af97c604fd39327c06b00f8
5
5
  SHA512:
6
- metadata.gz: b40e9dc02e6e447f20ba8f22c8c2916512b6d16204da16268f9156e5c48e77743adbacc51c06e0bb1df150bdf2d0fd2e9f6631ca1b2684830b76b72dfff06b9e
7
- data.tar.gz: a3a36894b7296ada17af461c3f61874f17c72be48f9307fc25b7b5e7940b6292a636249442f189fc38a8b966501bc45482202a3e7d9a5ddcf45d5bdd0e3b8078
6
+ metadata.gz: 1813cdeab5785b355c78b316ec8f36ad69b8ab0485c3ff190f318bb4058a54bb4d224b1a030cb0af6322cf600bfe54cd13fa6d4138383fb8dd76084e5ead6ec8
7
+ data.tar.gz: e8d606d27e30fe7e095214d1a7eb22fef82a98aac64dc7aefb63c62a0fcfa14e0c9e7cef3809952d9cd1033960cb377b2e249ffd954220b58793ec468c017701
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.10.3)
4
+ capistrano-nomad (0.10.5)
5
5
  activesupport (<= 7.0.8)
6
6
  byebug
7
7
  capistrano (~> 3.0)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "capistrano-nomad"
5
- spec.version = "0.10.3"
5
+ spec.version = "0.10.5"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -135,14 +135,18 @@ end
135
135
  def capistrano_nomad_find_job_task_details(name, namespace: :default, task: nil)
136
136
  task = task.presence || name
137
137
 
138
- # Find alloc id that contains task
138
+ # Find alloc id that contains task that is also running
139
139
  allocs_output = capistrano_nomad_capture_nomad_command(
140
140
  :job,
141
141
  :allocs,
142
- { namespace: namespace, t: "'{{range .}}{{ .ID }},{{ .TaskGroup }}|{{end}}'" },
142
+ { namespace: namespace, t: "'{{range .}}{{ .ID }},{{ .ClientStatus }},{{ .TaskGroup }}|{{end}}'" },
143
143
  name,
144
144
  )
145
- alloc_id = allocs_output.split("|").map { |s| s.split(",") }.find { |_, t| t == task.to_s }&.first
145
+ alloc_id = allocs_output
146
+ .split("|")
147
+ .map { |s| s.split(",") }
148
+ .find { |_, s, t| s == "running" && t == task.to_s }
149
+ &.first
146
150
 
147
151
  # Can't continue if we can't choose an alloc id
148
152
  return unless alloc_id
@@ -491,7 +495,9 @@ end
491
495
 
492
496
  def capistrano_nomad_restart_jobs(names, **options)
493
497
  names.each do |name|
494
- capistrano_nomad_execute_nomad_command(:job, :restart, options, name)
498
+ # Automatic yes to prompts. If set, the command automatically restarts multi-region jobs only in the region targeted
499
+ # by the command, ignores batch errors, and automatically proceeds with the remaining batches without waiting
500
+ capistrano_nomad_execute_nomad_command(:job, :restart, options.reverse_merge(yes: true), name)
495
501
  end
496
502
  end
497
503
 
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.10.3
4
+ version: 0.10.5
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-28 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport