capistrano-nomad 0.4.0 → 0.4.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e086bb0968563ebe8bc50d27aeae5fbf26c91c484e6bb4ff3774e06da3d013a
|
|
4
|
+
data.tar.gz: 190a466a7334240004d6e7ed7056555ad3872a331e22b2745124fb7394e166ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74a497827c062c431a59a9b102e4a1f6a3cb4a8c47a700c1acd2f6e6b3591c78aad734867dc649da9b0f616021949bdd9e69cc8031481086d29c7e0e9380d1b7
|
|
7
|
+
data.tar.gz: f765b3cf57ddf929bf1fb324218be5e093e9709f9bb56a3aef1c8ede338f33c5bbdcbe6c14b9a884fa046680164d9739c23c42fa2b27a843cf87f86b06e17fd6
|
data/Gemfile.lock
CHANGED
data/capistrano-nomad.gemspec
CHANGED
|
@@ -76,19 +76,13 @@ def capistrano_nomad_build_docker_image_for_type(image_type)
|
|
|
76
76
|
"--platform linux/amd64",
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
-
build_args =
|
|
80
|
-
if attributes[:build_args].is_a?(Proc)
|
|
81
|
-
proc_args = attributes[:build_args].arity == 1 ? [capistrano_nomad_fetch_git_commit_id] : []
|
|
82
|
-
|
|
83
|
-
attributes[:build_args].call(*proc_args)
|
|
84
|
-
else
|
|
85
|
-
attributes[:build_args]
|
|
86
|
-
end
|
|
87
|
-
|
|
88
79
|
if (target = attributes[:target])
|
|
89
80
|
args << "--target #{target}"
|
|
90
81
|
end
|
|
91
82
|
|
|
83
|
+
build_args = attributes[:build_args]
|
|
84
|
+
build_args = build_args.call if build_args&.is_a?(Proc)
|
|
85
|
+
|
|
92
86
|
(build_args || []).each do |key, value|
|
|
93
87
|
args << "--build-arg #{key}=#{value}"
|
|
94
88
|
end
|
|
@@ -4,6 +4,6 @@ def capistrano_nomad_git
|
|
|
4
4
|
@capistrano_nomad_git ||= Git.open(".")
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
def
|
|
8
|
-
capistrano_nomad_git.log.first.sha
|
|
7
|
+
def capistrano_nomad_git_commit_id
|
|
8
|
+
@capistrano_nomad_git_commit_id ||= capistrano_nomad_git.log.first.sha
|
|
9
9
|
end
|
|
@@ -106,7 +106,7 @@ def capistrano_nomad_execute_nomad_command(*args)
|
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def capistrano_nomad_exec_within_job(name, command, namespace: nil)
|
|
109
|
-
capistrano_nomad_execute_nomad_command(:alloc, :exec, { namespace: namespace, task: name, job:
|
|
109
|
+
capistrano_nomad_execute_nomad_command(:alloc, :exec, { namespace: namespace, task: name, job: true }, name, command)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def capistrano_nomad_upload_file(local_path:, remote_path:, erb_vars: {})
|
|
@@ -122,7 +122,7 @@ def capistrano_nomad_upload_file(local_path:, remote_path:, erb_vars: {})
|
|
|
122
122
|
erb = ERB.new(File.open(local_path).read, trim_mode: "-")
|
|
123
123
|
|
|
124
124
|
final_erb_vars = {
|
|
125
|
-
git_commit_id: fetch(:current_revision) ||
|
|
125
|
+
git_commit_id: fetch(:current_revision) || capistrano_nomad_git_commit_id,
|
|
126
126
|
docker_image_types: docker_image_types,
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -6,7 +6,7 @@ class Capistrano::SCM::GitLocal < Capistrano::SCM::Plugin
|
|
|
6
6
|
namespace :git_local do
|
|
7
7
|
task :set_current_revision do
|
|
8
8
|
on release_roles :manager do
|
|
9
|
-
set :current_revision,
|
|
9
|
+
set :current_revision, capistrano_nomad_git_commit_id
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|