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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/nomad.rb +1 -1
- data/test/upload_plan_test.rb +8 -4
- 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: b933f1a90e14c606e77ab78668614d0ddaa7dcceefe07ed3257b74f5dfc472f2
|
|
4
|
+
data.tar.gz: 9987bc206fd62a34d16f645ad95b32e6fbb07de96b05bdcb3ae973311b7a0c5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
data/capistrano-nomad.gemspec
CHANGED
|
@@ -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"
|
data/test/upload_plan_test.rb
CHANGED
|
@@ -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")
|