capistrano-nomad 0.2.2 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ccaa807c999207d2220ec964a010a83cee1c562d8ed6312bc2c2ddd1330be53
|
4
|
+
data.tar.gz: 0bf27b5d766d966ac96e6dc1ab215257596778c870364a9a9ee029bb9b539097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5528920fc76334182c1f958ae56f61320b8984df5101553610150105f5e93937bbefbb8a8ffa9374e7a2405870b03533994d8d1e1ff9f6946fd5d7f742c67c3
|
7
|
+
data.tar.gz: 7ff7460adefcfca53e20e59b5edf3231a817ebacf63fbdb1573caf1ed981f9dcd657bcee8f0dc4199012c268b22360fcfbd07949181d05ca83890187d8e7d9ef
|
data/Gemfile.lock
CHANGED
data/capistrano-nomad.gemspec
CHANGED
@@ -61,16 +61,18 @@ def capistrano_nomad_build_docker_image(image_type, path, *args)
|
|
61
61
|
capistrano_nomad_build_docker_image_alias(image_type, git_commit_id),
|
62
62
|
capistrano_nomad_build_docker_image_alias(image_type, "latest"),
|
63
63
|
"trunk/#{fetch(:stage)}/#{image_type}:latest",
|
64
|
-
]
|
65
|
-
|
66
|
-
|
64
|
+
]
|
65
|
+
.compact
|
66
|
+
.each do |tag|
|
67
|
+
args << "--tag #{tag}"
|
68
|
+
end
|
67
69
|
|
68
70
|
# If any of these files exist then we're in the middle of rebase so we should interrupt
|
69
|
-
if ["rebase-merge", "rebase-apply"].any? { |f| File.exist?("#{
|
71
|
+
if ["rebase-merge", "rebase-apply"].any? { |f| File.exist?("#{capistrano_nomad_git.dir.path}/.git/#{f}") }
|
70
72
|
raise StandardError, "still in the middle of git rebase, interrupting docker image build"
|
71
73
|
end
|
72
74
|
|
73
|
-
system "docker build #{args.join(' ')}
|
75
|
+
system "docker build #{args.join(' ')} .#{capistrano_nomad_root.join(path)}"
|
74
76
|
end
|
75
77
|
end
|
76
78
|
|
@@ -36,9 +36,6 @@ class NomadErbNamespace
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def capistrano_nomad_build_file_path(parent_path, basename, namespace: nil)
|
39
|
-
# Remove initial slash if it exists
|
40
|
-
parent_path = parent_path[1..] if parent_path[0] == "/"
|
41
|
-
|
42
39
|
segments = [parent_path]
|
43
40
|
segments << namespace if namespace
|
44
41
|
segments << "#{basename}.hcl"
|
@@ -54,19 +51,31 @@ def capistrano_nomad_build_base_var_file_path(*args)
|
|
54
51
|
capistrano_nomad_build_file_path(fetch(:nomad_var_files_path), *args)
|
55
52
|
end
|
56
53
|
|
57
|
-
def
|
58
|
-
local_path =
|
54
|
+
def capistrano_nomad_build_local_path(path, *args)
|
55
|
+
local_path = ".#{capistrano_nomad_root.join(path)}"
|
59
56
|
|
60
57
|
# Determine if it has .erb appended or not
|
61
|
-
[local_path, "#{local_path}.erb"].find { |path| File.exist?(path) }
|
58
|
+
found_local_path = [local_path, "#{local_path}.erb"].find { |path| File.exist?(path) }
|
59
|
+
|
60
|
+
raise StandardError, "Could not find local path: #{path}" unless found_local_path
|
61
|
+
|
62
|
+
found_local_path
|
63
|
+
end
|
64
|
+
|
65
|
+
def capistrano_nomad_build_local_job_path(name, *args)
|
66
|
+
capistrano_nomad_build_local_path(capistrano_nomad_build_base_job_path(name, *args))
|
67
|
+
end
|
68
|
+
|
69
|
+
def capistrano_nomad_build_local_var_file_path(name, *args)
|
70
|
+
capistrano_nomad_build_local_path(capistrano_nomad_build_base_var_file_path(name, *args))
|
62
71
|
end
|
63
72
|
|
64
73
|
def capistrano_nomad_build_release_job_path(*args)
|
65
|
-
"#{release_path}
|
74
|
+
"#{release_path}#{capistrano_nomad_build_base_job_path(*args)}"
|
66
75
|
end
|
67
76
|
|
68
77
|
def capistrano_nomad_build_release_var_file_path(*args)
|
69
|
-
"#{release_path}
|
78
|
+
"#{release_path}#{capistrano_nomad_build_base_var_file_path(*args)}"
|
70
79
|
end
|
71
80
|
|
72
81
|
def capistrano_nomad_execute_nomad_command(*args)
|
@@ -158,7 +167,7 @@ def capistrano_nomad_build_jobs_docker_images(names, *args)
|
|
158
167
|
|
159
168
|
return false if image_types.empty?
|
160
169
|
|
161
|
-
image_types.each { |i| capistrano_nomad_build_docker_image_for_type(i
|
170
|
+
image_types.each { |i| capistrano_nomad_build_docker_image_for_type(i) }
|
162
171
|
end
|
163
172
|
|
164
173
|
def capistrano_nomad_push_jobs_docker_images(names, *args)
|
@@ -166,7 +175,7 @@ def capistrano_nomad_push_jobs_docker_images(names, *args)
|
|
166
175
|
|
167
176
|
return false if image_types.empty?
|
168
177
|
|
169
|
-
image_types.each { |i| capistrano_nomad_push_docker_image_for_type(i
|
178
|
+
image_types.each { |i| capistrano_nomad_push_docker_image_for_type(i) }
|
170
179
|
end
|
171
180
|
|
172
181
|
def capistrano_nomad_assemble_jobs_docker_images(names, *args)
|
@@ -180,7 +189,7 @@ def capistrano_nomad_upload_jobs(names, *args)
|
|
180
189
|
|
181
190
|
uniq_var_files.each do |var_file|
|
182
191
|
capistrano_nomad_upload_file(
|
183
|
-
local_path:
|
192
|
+
local_path: capistrano_nomad_build_local_var_file_path(var_file, *args),
|
184
193
|
remote_path: capistrano_nomad_build_release_var_file_path(var_file, *args),
|
185
194
|
)
|
186
195
|
end
|
@@ -196,7 +205,7 @@ def capistrano_nomad_upload_jobs(names, *args)
|
|
196
205
|
file_basename = nomad_job_options[:template] || name
|
197
206
|
|
198
207
|
capistrano_nomad_upload_file(
|
199
|
-
local_path:
|
208
|
+
local_path: capistrano_nomad_build_local_job_path(file_basename, *args),
|
200
209
|
remote_path: capistrano_nomad_build_release_job_path(name, *args),
|
201
210
|
erb_vars: erb_vars,
|
202
211
|
)
|
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.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Hu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|