clc-promote 0.4.0.dev.10 → 0.4.0.dev.11

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: 7b8ab84ce0ba21d1a3b3f18d6b02abe59efa5a00
4
- data.tar.gz: ee739681a924fe27a52e22f1a667614e51d4bc89
3
+ metadata.gz: e49cd149f5b8ba51f62bd51e581d02e80f27aac6
4
+ data.tar.gz: 95f67b6a4c673a7e2faca2414c90edbbca27991b
5
5
  SHA512:
6
- metadata.gz: 5b3a3be74b3fd8de3a9a45a8232422bbe1ef07a5dd744d869541c21405e577d283591971640152dc9d4b9b0c86f849a6b3da9396b3c7da234d5942da4c587a45
7
- data.tar.gz: 6949e045d8623ea3266ca41a15ef85c5cc86021a2c08788aaec610acbf27552a455f1dd6be572fbc94e646fb3cef8cae41c647fd7e620383c6466e4852904994
6
+ metadata.gz: 52f86fbbc3ee7066968a798fef4fa554d3751668557a91d2fcbad62a512d9c05a9fc8d517ec8de759a2c0668af71c2a1bc1c071d5098280576c9762d03c2e8c7
7
+ data.tar.gz: bc34131bcbc8a9b8c7d85ee354cefbf22df96b80f8a011e14393d501005f5a1c88cd00739ddca57b0fa0af0eeb88638ebe8a2c9269e9a070495732b5280bde54
@@ -6,7 +6,7 @@ module Promote
6
6
 
7
7
  def version_number
8
8
  all_commit_count = log.size
9
- bump_commit_count = log.grep("CI:versioning chef artifacts").size
9
+ bump_commit_count = log.grep("CI:bumping").size
10
10
  commit_count = all_commit_count - bump_commit_count
11
11
  "#{current_tag.name}.#{commit_count}"
12
12
  end
@@ -31,7 +31,7 @@ module Promote
31
31
  berksfile = Berkshelf::Berksfile.from_file(berksfile_path)
32
32
  berksfile.vendor(vendor_path)
33
33
 
34
- upload_filtered_cookbooks([vendor_path])
34
+ upload_filtered_cookbooks(Dir.glob(File.join(vendor_path,'*')))
35
35
  end
36
36
 
37
37
  def upload_cookbooks(environment = nil)
@@ -40,28 +40,6 @@ module Promote
40
40
 
41
41
  upload_filtered_cookbooks(dirs, environment)
42
42
  end
43
-
44
- def upload_filtered_cookbooks(dirs, environment = nil)
45
- anything_to_upload = false
46
-
47
- server_cookbooks = Utils.chef_server_cookbooks(config)
48
- if environment.nil?
49
- env_versions = nil
50
- else
51
- env_versions = EnvironmentFile.new(environment, config).cookbook_versions
52
- end
53
-
54
- FileUtils.rm_rf(config.temp_directory) if Dir.exist?(config.temp_directory)
55
- Dir.mkdir(config.temp_directory)
56
-
57
- dirs.each do | dir |
58
- anything_to_upload = cookbooks_copied?(dir, server_cookbooks, env_versions) || anything_to_upload
59
- end
60
-
61
- if anything_to_upload
62
- upload_cookbook_directory(config.temp_directory)
63
- end
64
- end
65
43
 
66
44
  def upload_cookbook_directory(directory)
67
45
  if !Dir.glob(File.join(config.cookbook_directory, "*")).empty?
@@ -89,6 +67,28 @@ module Promote
89
67
 
90
68
  private
91
69
 
70
+ def upload_filtered_cookbooks(dirs, environment = nil)
71
+ anything_to_upload = false
72
+
73
+ server_cookbooks = Utils.chef_server_cookbooks(config)
74
+ if environment.nil?
75
+ env_versions = nil
76
+ else
77
+ env_versions = EnvironmentFile.new(environment, config).cookbook_versions
78
+ end
79
+
80
+ FileUtils.rm_rf(config.temp_directory) if Dir.exist?(config.temp_directory)
81
+ Dir.mkdir(config.temp_directory)
82
+
83
+ dirs.each do | dir |
84
+ anything_to_upload = cookbooks_copied?(dir, server_cookbooks, env_versions) || anything_to_upload
85
+ end
86
+
87
+ if anything_to_upload
88
+ upload_cookbook_directory(config.temp_directory)
89
+ end
90
+ end
91
+
92
92
  #only include versions in environment but exclude whats on the server
93
93
  def cookbooks_copied?(dir, server_cookbooks, environment_cookbooks)
94
94
  metadata = Chef::Cookbook::Metadata.new
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.10
4
+ version: 0.4.0.dev.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - CenturyLink Cloud