capistrano-nomad 0.16.3 → 0.16.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56224de9c341668aba37b58d2b0b404decfce7ee5f488364c325319fea262572
4
- data.tar.gz: 49275ee4444defa39b4de8e6d193342d63b8a1edd08deb6f4946451c8c4b9cf2
3
+ metadata.gz: b933f1a90e14c606e77ab78668614d0ddaa7dcceefe07ed3257b74f5dfc472f2
4
+ data.tar.gz: 9987bc206fd62a34d16f645ad95b32e6fbb07de96b05bdcb3ae973311b7a0c5a
5
5
  SHA512:
6
- metadata.gz: 10e0218ac88de63102cb0af504e7eec43985535516d6fcd91c5404224003b4a652e500bef48895707f4532ca83ebac128aef143d6b38571e490eca632bac91c2
7
- data.tar.gz: 7b53eee7196177a352c757527911ccfb601c8075918f49c8a3557cfc61da571fb707341802affb138fbcb903b13c92e09a619431a6f657ee2bc651ddced4df5f
6
+ metadata.gz: 16f9c69beec42b4633a368f2de327ff266dd06514685e2c626323f7cd5c483dc0df4bc57b3effc8e10848e62300da7b00c67f9ed8c2a2e3b52501fe831fb4814
7
+ data.tar.gz: 911b1f701fabfd92e31b23d79b2e15259726dad29e7bc2c9cbd2c1ff7b897add13d57a97dc133fb03ffbb374b809ed290fc86dceb5bd302eef4a28fc85bb9a87
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.16.4]
4
+
5
+ - Request raw JSON when inspecting periodic jobs so the force task reads the deployed periodic configuration
6
+
3
7
  ## [0.16.3]
4
8
 
5
9
  - Add a generated `:force` task to launch a periodic child through the configured manager host and Nomad token
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.16.3)
4
+ capistrano-nomad (0.16.4)
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.16.3"
5
+ spec.version = "0.16.4"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -636,7 +636,7 @@ end
636
636
 
637
637
  def capistrano_nomad_force_job(name, **options)
638
638
  capistrano_nomad_ensure_options!(options)
639
- job = JSON.parse(capistrano_nomad_capture_nomad_command(:job, :inspect, options, name, raise_on_non_zero_exit: true))
639
+ job = JSON.parse(capistrano_nomad_capture_nomad_command(:job, :inspect, options.merge(json: true), name, raise_on_non_zero_exit: true))
640
640
 
641
641
  unless job.dig("Periodic", "Enabled")
642
642
  raise ArgumentError, "Job #{options[:namespace]}/#{name} is not an enabled periodic job"
@@ -44,6 +44,10 @@ class UploadPlanTest < Minitest::Test
44
44
  [ "$NOMAD_TOKEN" = force-test-token ] || exit 98
45
45
  printf '%s\n' "$*" >> #{root}/commands
46
46
  if [ "$2" = inspect ]; then
47
+ case "$*" in
48
+ *-json*) ;;
49
+ *) echo '{"Job":{}}'; exit 0;;
50
+ esac
47
51
  printf '%s\n' "$NOMAD_TEST_JOB"
48
52
  exit "${NOMAD_TEST_INSPECT_EXIT:-0}"
49
53
  fi
@@ -92,7 +96,7 @@ class UploadPlanTest < Minitest::Test
92
96
  chdir: root,
93
97
  )
94
98
 
95
- assert_equal("job inspect -namespace=spleencheese myanonamouse-maintenance\njob periodic force -namespace=spleencheese myanonamouse-maintenance\n", File.read("#{root}/commands"), output)
99
+ assert_equal("job inspect -namespace=spleencheese -json myanonamouse-maintenance\njob periodic force -namespace=spleencheese myanonamouse-maintenance\n", File.read("#{root}/commands"), output)
96
100
  assert_equal(exit_code.zero?, status.success?, output)
97
101
  assert_includes(output, exit_code.zero? ? "Created periodic child" : "Periodic force rejected")
98
102
  end
@@ -107,7 +111,7 @@ class UploadPlanTest < Minitest::Test
107
111
 
108
112
  refute(status.success?, output)
109
113
  assert_includes(output, "Job default/example is not an enabled periodic job")
110
- assert_equal("job inspect -namespace=default example\n", File.read("#{root}/commands"), output)
114
+ assert_equal("job inspect -namespace=default -json example\n", File.read("#{root}/commands"), output)
111
115
  end
112
116
 
113
117
  File.write("#{root}/commands", "")
@@ -118,7 +122,7 @@ class UploadPlanTest < Minitest::Test
118
122
  )
119
123
 
120
124
  refute(status.success?, output)
121
- assert_equal("job inspect -namespace=default example\n", File.read("#{root}/commands"), output)
125
+ assert_equal("job inspect -namespace=default -json example\n", File.read("#{root}/commands"), output)
122
126
 
123
127
  File.write("#{root}/commands", "")
124
128
  output, status = Open3.capture2e(
@@ -128,7 +132,7 @@ class UploadPlanTest < Minitest::Test
128
132
  )
129
133
 
130
134
  assert(status.success?, output)
131
- assert_equal("job inspect -namespace=default example\njob periodic force -namespace=default example\n", File.read("#{root}/commands"), output)
135
+ assert_equal("job inspect -namespace=default -json example\njob periodic force -namespace=default example\n", File.read("#{root}/commands"), output)
132
136
 
133
137
  if ENV["NOMAD_REAL_BINARY"]
134
138
  FileUtils.cp(ENV.fetch("NOMAD_REAL_BINARY"), "#{root}/bin/nomad")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nomad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
4
+ version: 0.16.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hu