capistrano-nomad 0.10.1 → 0.10.3

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: 76af53f1a2764deb4b91363674b6627d7b6017a30609e067d42b66cdbd5c9fc0
4
- data.tar.gz: 64825bb8a9bdccf833f23cb36aeb10cba6f516bbac8e6690193eb1674339fb94
3
+ metadata.gz: 9e53ea71739d8bf0e6a35acc8fc6cf53b38793e2cb84406eabcbcae39eb3c95a
4
+ data.tar.gz: 9acd6a38e395394f5b6fd2c29b7f79ff57ab4b5f03580b507131f4f14fa0e73c
5
5
  SHA512:
6
- metadata.gz: d359a15febd84d1303360f8d9c51faf026fa6388cf6a8b97edc7fa99cee59007c4999d040935bad0351ad1fa3bc1aca5908819b1cd1fc302d711b09a7d3a42e6
7
- data.tar.gz: 5bf77756a9d1dc2bc28ded978f0523fff65059932154c1930545dd4b06930012d45ed646108f593802e606559b2aa4c2cae867f2012bef83245308b30d1a52dd
6
+ metadata.gz: b40e9dc02e6e447f20ba8f22c8c2916512b6d16204da16268f9156e5c48e77743adbacc51c06e0bb1df150bdf2d0fd2e9f6631ca1b2684830b76b72dfff06b9e
7
+ data.tar.gz: a3a36894b7296ada17af461c3f61874f17c72be48f9307fc25b7b5e7940b6292a636249442f189fc38a8b966501bc45482202a3e7d9a5ddcf45d5bdd0e3b8078
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.10.1)
4
+ capistrano-nomad (0.10.3)
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.1"
5
+ spec.version = "0.10.3"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -16,6 +16,8 @@ def nomad_docker_image_type(image_type, attributes = {})
16
16
  end
17
17
 
18
18
  def nomad_namespace(namespace, **options, &block)
19
+ raise ArgumentError, "cannot define default nomad namespace" if namespace == :default
20
+
19
21
  nomad_namespaces = fetch(:nomad_namespaces) || {}
20
22
  nomad_namespaces[namespace] = options
21
23
  set(:nomad_namespaces, nomad_namespaces)
@@ -53,7 +55,7 @@ def nomad_job(name, attributes = {})
53
55
 
54
56
  define_tasks = lambda do |namespace: nil|
55
57
  description_name = ""
56
- description_name << "#{namespace}/" if namespace
58
+ description_name << "#{namespace}/" if namespace != :default
57
59
  description_name << name.to_s
58
60
 
59
61
  namespace(name) do
@@ -164,8 +166,10 @@ def nomad_job(name, attributes = {})
164
166
  end
165
167
 
166
168
  namespace(:nomad) do
167
- # Define tasks for service
168
169
  if @nomad_namespace
170
+ # Also define tasks without namespace for default Nomad namespace
171
+ define_tasks.call(namespace: @nomad_namespace) if @nomad_namespace == :default
172
+
169
173
  namespace(@nomad_namespace) do
170
174
  define_tasks.call(namespace: @nomad_namespace)
171
175
  end
@@ -32,7 +32,7 @@ end
32
32
  def capistrano_nomad_build_file_path(parent_path, basename, kind: nil, namespace: :default)
33
33
  segments = [parent_path]
34
34
 
35
- if namespace
35
+ unless namespace == :default
36
36
  case kind
37
37
 
38
38
  # Always upload to namespace folder on remote
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.10.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hu