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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/exe/dctl +14 -6
  4. data/lib/dctl/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3ae83ed9a27583eb0a2b019dd4d0930c4a9fd8e318520bcdcbe71f9d8690f2f
4
- data.tar.gz: 63b5f032b93c54d125ee3a798e9cdeb3ea9a10ccea5799949cab193751b6fc6d
3
+ metadata.gz: 68f259d4d14228322b0da58bec4b4a2d47a71c4479fae91c3a00522c0117ec1b
4
+ data.tar.gz: d60f4c417658802a8e44c882f50ad6daab5dcc1d76e2514f32451c35ebce7c17
5
5
  SHA512:
6
- metadata.gz: 8f64d03907aea231b974712e265ae1037e686812c11976a6ebaffdecb38d4479cf858698fb3000d2309aa03cd882d41c58a67b23c64092bd4d1f381091370b2a
7
- data.tar.gz: 46166eb3231a78a77876b8475c7be916126b9c02b6b3491a2536ba2ebf4f5bf15390ad57fd0102695ca3157452d33258f13d347c6d418b4d0ce082a97010f1f4
6
+ metadata.gz: fb0bcc8ab1aa3e616c2684215d99c4c893ada9d4db9f16c75bce8aa5449e996d959590e095d6aec10439c7811192c211b3f5b4bfe944ff358a7b814f2e1e7ebc
7
+ data.tar.gz: 1938e201c5c9655fe66258486bbd87b9d9cc5282e5c317176275d9cb02b416c7dea9bc18ba135539638ec779ab616041857679e4cdfa242be081b639e30a6fba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dctl_rb (0.10.0)
4
+ dctl_rb (0.10.1)
5
5
  config (>= 1, < 2)
6
6
  rainbow (>= 2.2, < 3)
7
7
  rake (~> 12)
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, default: false
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
- build_opts = %W(
35
- -f=#{dockerfile}
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
@@ -1,3 +1,3 @@
1
1
  module Dctl
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler