dctl_rb 0.10.0 → 0.10.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 +4 -4
- data/Gemfile.lock +1 -1
- data/exe/dctl +14 -6
- data/lib/dctl/version.rb +1 -1
- 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: 68f259d4d14228322b0da58bec4b4a2d47a71c4479fae91c3a00522c0117ec1b
|
4
|
+
data.tar.gz: d60f4c417658802a8e44c882f50ad6daab5dcc1d76e2514f32451c35ebce7c17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0bcc8ab1aa3e616c2684215d99c4c893ada9d4db9f16c75bce8aa5449e996d959590e095d6aec10439c7811192c211b3f5b4bfe944ff358a7b814f2e1e7ebc
|
7
|
+
data.tar.gz: 1938e201c5c9655fe66258486bbd87b9d9cc5282e5c317176275d9cb02b416c7dea9bc18ba135539638ec779ab616041857679e4cdfa242be081b639e30a6fba
|
data/Gemfile.lock
CHANGED
data/exe/dctl
CHANGED
@@ -17,9 +17,19 @@ module Dctl
|
|
17
17
|
class_option :host, type: :string
|
18
18
|
|
19
19
|
desc "build", "Build images. Pass image name to build a specific one; otherwise builds all"
|
20
|
-
option :pull, type: :boolean,
|
20
|
+
option :pull, type: :boolean, desc: "Pull before building (same as docker build --pull)"
|
21
21
|
option :cache_from, type: :string
|
22
|
+
option :cache_from_self, type: :boolean, desc: "Uses the tag being built " \
|
23
|
+
"as the cache source. Useful for rebuilding images where the cache is " \
|
24
|
+
"not available (e.g. CI)"
|
22
25
|
def build(*images)
|
26
|
+
if options[:cache_from] && options[:cache_from_self]
|
27
|
+
error = "--cache-from and --cache-from-self are mutually exclusive: " \
|
28
|
+
"Please specify only one at a time."
|
29
|
+
puts Rainbow(error).fg ERROR_COLOR
|
30
|
+
exit 1
|
31
|
+
end
|
32
|
+
|
23
33
|
dctl = Dctl::Main.new env: options[:env]
|
24
34
|
images = dctl.expand_images *images
|
25
35
|
env = options[:env]
|
@@ -27,15 +37,13 @@ module Dctl
|
|
27
37
|
puts "Generating build script for #{images.join(", ")}"
|
28
38
|
commands = []
|
29
39
|
|
30
|
-
|
31
40
|
images.each do |image|
|
32
41
|
tag = dctl.image_tag(image)
|
33
42
|
dockerfile = dctl.image_dockerfile(image)
|
34
|
-
|
35
|
-
|
36
|
-
-t=#{tag}
|
37
|
-
)
|
43
|
+
|
44
|
+
build_opts = %W(-f=#{dockerfile} -t=#{tag})
|
38
45
|
build_opts << "--pull=true" if options[:pull]
|
46
|
+
build_opts << "--cache-from=#{tag}" if options[:cache_from_self]
|
39
47
|
if options[:cache_from]
|
40
48
|
if images.size > 1
|
41
49
|
error = "--cache-from is only supported when building a single " \
|
data/lib/dctl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dctl_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Toniazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|