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 +4 -4
- data/lib/promote/git_repo.rb +1 -1
- data/lib/promote/uploader.rb +23 -23
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e49cd149f5b8ba51f62bd51e581d02e80f27aac6
|
4
|
+
data.tar.gz: 95f67b6a4c673a7e2faca2414c90edbbca27991b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f86fbbc3ee7066968a798fef4fa554d3751668557a91d2fcbad62a512d9c05a9fc8d517ec8de759a2c0668af71c2a1bc1c071d5098280576c9762d03c2e8c7
|
7
|
+
data.tar.gz: bc34131bcbc8a9b8c7d85ee354cefbf22df96b80f8a011e14393d501005f5a1c88cd00739ddca57b0fa0af0eeb88638ebe8a2c9269e9a070495732b5280bde54
|
data/lib/promote/git_repo.rb
CHANGED
@@ -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:
|
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
|
data/lib/promote/uploader.rb
CHANGED
@@ -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(
|
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
|