clc-promote 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/promote/uploader.rb +12 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42ef2170949ab27a3c7c84032933a7517e4224a5
|
4
|
+
data.tar.gz: 173b76839baf1b85faa5da8300344a64b0a84133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2194f0b7cdf87daa32ae5e4962d2c28f2a05f506ecb790012867541b89e9887621120ea673ea21afcf9ca0d9be8fd5fb175d5d503154640c3be19b57a71e265
|
7
|
+
data.tar.gz: 6ad31cdbf4cb7a2fffe60773635dfccee0edab349f5b628ad5be19cf2de7e41478d492127dce4073f91e341a3d5197ed246884390d3d412d7eb740e4e549b634
|
data/lib/promote/uploader.rb
CHANGED
@@ -22,12 +22,16 @@ module Promote
|
|
22
22
|
Chef::Config[:chef_repo_path] = config.repo_root
|
23
23
|
end
|
24
24
|
|
25
|
-
def upload_cookbooks(environment)
|
25
|
+
def upload_cookbooks(environment = nil)
|
26
26
|
anything_to_upload = false
|
27
27
|
|
28
28
|
server_cookbooks = Utils.chef_server_cookbooks(config)
|
29
|
-
|
30
|
-
|
29
|
+
if environment.nil?
|
30
|
+
env_versions = nil
|
31
|
+
else
|
32
|
+
env_versions = EnvironmentFile.new(environment, config).cookbook_versions
|
33
|
+
end
|
34
|
+
|
31
35
|
FileUtils.rm_rf(config.temp_directory) if Dir.exist?(config.temp_directory)
|
32
36
|
Dir.mkdir(config.temp_directory)
|
33
37
|
|
@@ -55,6 +59,10 @@ module Promote
|
|
55
59
|
upload_file("/environments/#{environment_name}.json")
|
56
60
|
end
|
57
61
|
|
62
|
+
def upload_environments
|
63
|
+
upload_file("/environments/**/*.json")
|
64
|
+
end
|
65
|
+
|
58
66
|
def upload_data_bags
|
59
67
|
upload_file("/data_bags/**/*.json")
|
60
68
|
end
|
@@ -74,7 +82,7 @@ module Promote
|
|
74
82
|
end
|
75
83
|
|
76
84
|
if !server_cookbooks.has_key?(metadata.name) || (server_cookbooks[metadata.name]["versions"].select {|v| v['version'] == metadata.version}).empty?
|
77
|
-
if environment_cookbooks.has_key?(metadata.name) && environment_cookbooks[metadata.name] == metadata.version
|
85
|
+
if environment_cookbooks.nil? || (environment_cookbooks.has_key?(metadata.name) && environment_cookbooks[metadata.name] == metadata.version)
|
78
86
|
FileUtils.copy_entry(dir, File.join(config.temp_directory, metadata.name))
|
79
87
|
true
|
80
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clc-promote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CenturyLink Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.4.1
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Provides versioning and promotion logic for chef artifacts.
|