capistrano-nomad 0.8.2 → 0.8.3
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/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/capistrano-nomad.gemspec +1 -1
- data/lib/capistrano/nomad/helpers/docker.rb +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05ca5407915d371647ac8f0a856b1469313a666f00db80d781b50de0b9bc2f4f
|
|
4
|
+
data.tar.gz: 98e1e339f24d011fe3bc751d31c0174cf39330ce201fd74609c24f07977c4fae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 760b8a91e198f34dcc981cb645dd4e4e6b5144a939d890452e20630dad831202473c6f002de3c6f0370c9ba1e1d7ef2cd7ea3795d80abbb9d56169ac82ad86c7
|
|
7
|
+
data.tar.gz: 1de68b27f9b918ceb16c7045dccacc1cd151937888f850fd3a57606cb10fb86051b511a3212aff4487102a79b080dbe7cc3f0a6b50bf9bfd4a7f41eada2ec5f1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -49,6 +49,19 @@ set :nomad_template_vars, (lambda do
|
|
|
49
49
|
}
|
|
50
50
|
end)
|
|
51
51
|
|
|
52
|
+
# Change docker build command
|
|
53
|
+
set :nomad_docker_build_command, (lambda do
|
|
54
|
+
"docker buildx build"
|
|
55
|
+
end)
|
|
56
|
+
|
|
57
|
+
# Pass additional options into `docker build`
|
|
58
|
+
set :nomad_docker_build_command_options, (lambda do
|
|
59
|
+
[
|
|
60
|
+
"--cache-to type=gha",
|
|
61
|
+
"--cache-from type=gha",
|
|
62
|
+
]
|
|
63
|
+
end)
|
|
64
|
+
|
|
52
65
|
# Make helpers available to all template .erb files
|
|
53
66
|
nomad_template_helpers do
|
|
54
67
|
def restart_stanza(interval = "1m")
|
data/capistrano-nomad.gemspec
CHANGED
|
@@ -67,39 +67,39 @@ end
|
|
|
67
67
|
def capistrano_nomad_build_docker_image_for_type(image_type)
|
|
68
68
|
image_type = image_type.to_sym
|
|
69
69
|
attributes = fetch(:nomad_docker_image_types)[image_type]
|
|
70
|
+
command = fetch(:nomad_docker_build_command) || "docker build"
|
|
71
|
+
options = Array(fetch(:nomad_docker_build_command_options)) || []
|
|
70
72
|
|
|
71
73
|
return unless attributes
|
|
72
74
|
|
|
73
75
|
# No need to build if there's no path
|
|
74
76
|
return unless attributes[:path]
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"--platform linux/amd64",
|
|
80
|
-
]
|
|
78
|
+
# Ensure images are built for x86_64 which is production env otherwise it will default to local development env which
|
|
79
|
+
# can be arm64 (Apple Silicon)
|
|
80
|
+
options << "--platform linux/amd64"
|
|
81
81
|
|
|
82
82
|
if (target = attributes[:target])
|
|
83
|
-
|
|
83
|
+
options << "--target #{target}"
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
build_args = attributes[:build_args]
|
|
87
87
|
build_args = build_args.call if build_args&.is_a?(Proc)
|
|
88
88
|
|
|
89
89
|
(build_args || []).each do |key, value|
|
|
90
|
-
|
|
90
|
+
options << "--build-arg #{key}=#{value}"
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
docker_build_command = lambda do |path|
|
|
94
|
-
|
|
94
|
+
image_alias_options = options.dup
|
|
95
95
|
|
|
96
96
|
[capistrano_nomad_build_docker_image_alias(image_type)]
|
|
97
97
|
.compact
|
|
98
98
|
.each do |tag|
|
|
99
|
-
|
|
99
|
+
image_alias_options << "--tag #{tag}"
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
"
|
|
102
|
+
"#{command} #{image_alias_options.join(' ')} #{path}"
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
case attributes[:strategy]
|
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.8.
|
|
4
|
+
version: 0.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Hu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-05-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|