clc-promote 0.4.0.dev.12 → 0.4.0.dev.13

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
  SHA1:
3
- metadata.gz: 670e429e00ceab15d19bb19a097dd3ab10717bfb
4
- data.tar.gz: be83e3ba47626dc64cf3a2be73f6531e4fa14ddf
3
+ metadata.gz: d535a11af603a2375533a83c09e023059a6a9743
4
+ data.tar.gz: 3e429dfb0d05a97d6404b801850488db420d3af7
5
5
  SHA512:
6
- metadata.gz: 5c1b72d5ecb7e624b84f91de11262ae7d97e7edf849cbfe2ba9fa1004df10a4af1058ed0b8bad4271cf8ed658b1e2aaaf9499ed6688bc6d8a21818fb4bfaab5e
7
- data.tar.gz: 19fd31512df7508a1e031571815310f16ffd86ebce0cc20e43d9b35c8287b63f896e8b904507fd407925e09c4603bb8fb2cd5b0b3176fd6288d86278853d89be
6
+ metadata.gz: 9e0d48616601ca4ed7c275f6c551955a65c9bb1c8b12815e33836826c5bf7b37ae656ee012c21d36f96656828bbf8e3232a4cc808fefa111f74733e57be8735a
7
+ data.tar.gz: bcb55d7ad66d311a26e1a523f2ebf8fbe8ab44ef3226720ce6d2dad6dbb88ddc502294d25af8ef98005f10827943097dbdf6f6c9712627c8f96afba78c209364
@@ -52,9 +52,9 @@ module Promote
52
52
  def define_sync_berksfile
53
53
  namespace "Promote" do
54
54
  desc "Syncs a Berksfile.lock file"
55
- task "sync_berksfile", :cookbook do |task, args|
55
+ task "sync_berksfile", :cookbook, :update do |task, args|
56
56
  puts "Syncing berksfile.lock for #{args.cookbook}..."
57
- @versioner.sync_berksfile(args.cookbook)
57
+ @versioner.sync_berksfile(args.cookbook, args.update)
58
58
  end
59
59
  end
60
60
  end
data/lib/promote/utils.rb CHANGED
@@ -7,19 +7,19 @@ module Promote
7
7
  rest.get_rest("/cookbooks?num_versions=all")
8
8
  end
9
9
 
10
- def self.sync_berksfiles(cookbook_directory)
10
+ def self.sync_berksfiles(cookbook_directory, update)
11
11
  repo_cookbooks = Dir.glob(File.join(cookbook_directory, "*"))
12
12
  repo_cookbooks.each do |cookbook|
13
- sync_berksfile(cookbook)
13
+ sync_berksfile(cookbook, update)
14
14
  end
15
15
  end
16
16
 
17
- def self.sync_berksfile(cookbook_root)
17
+ def self.sync_berksfile(cookbook_root, update)
18
18
  berks_name = File.join(cookbook_root, "Berksfile")
19
19
  if File.exist?(berks_name)
20
20
  Berkshelf.set_format :null
21
21
  berksfile = Berkshelf::Berksfile.from_file(berks_name)
22
- berksfile.install
22
+ update ? berksfile.update : berksfile.install
23
23
  end
24
24
  end
25
25
  end
@@ -45,12 +45,12 @@ module Promote
45
45
  results
46
46
  end
47
47
 
48
- def sync_berksfile(cookbook_name)
49
- Utils.sync_berksfile(File.join(config.cookbook_directory, cookbook_name))
48
+ def sync_berksfile(cookbook_name, update = false)
49
+ Utils.sync_berksfile(File.join(config.cookbook_directory, cookbook_name), update)
50
50
  end
51
51
 
52
- def sync_berksfiles
53
- Utils.sync_berksfiles(config.cookbook_directory)
52
+ def sync_berksfiles(update = false)
53
+ Utils.sync_berksfiles(config.cookbook_directory, update)
54
54
  end
55
55
 
56
56
  def version_environment(environment_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clc-promote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.dev.12
4
+ version: 0.4.0.dev.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - CenturyLink Cloud