builderator 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -22
- data/VERSION +1 -1
- data/lib/builderator/tasks.rb +1 -1
- data/lib/builderator/tasks/packer.rb +30 -21
- data/rvm.env +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89e14c2393d87e5b4a95b6e08442efde1b56a3d2
|
4
|
+
data.tar.gz: 5c0e467fc4f9228e7d2c981ecd607c1659072d7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87cb9385e02b95d9672ab4fceb21bd905b27e6aeaa142d317e3ef182888851999e0db0400703a86d6d65b2934567715a4509222f701b62cd5097bc866d31254a
|
7
|
+
data.tar.gz: 0448ea00eb5a00064975a18df49d468e17da249b2eb8cf48ea52109ff0136c8c4b194ffa0bfb2bf2ebddcff2953130e469936a4322412d937a98ab5f69f9a2d0
|
data/Gemfile.lock
CHANGED
@@ -15,12 +15,12 @@ GEM
|
|
15
15
|
specs:
|
16
16
|
addressable (2.4.0)
|
17
17
|
ast (2.3.0)
|
18
|
-
aws-sdk (2.3.
|
19
|
-
aws-sdk-resources (= 2.3.
|
20
|
-
aws-sdk-core (2.3.
|
18
|
+
aws-sdk (2.3.13)
|
19
|
+
aws-sdk-resources (= 2.3.13)
|
20
|
+
aws-sdk-core (2.3.13)
|
21
21
|
jmespath (~> 1.0)
|
22
|
-
aws-sdk-resources (2.3.
|
23
|
-
aws-sdk-core (= 2.3.
|
22
|
+
aws-sdk-resources (2.3.13)
|
23
|
+
aws-sdk-core (= 2.3.13)
|
24
24
|
berkshelf (4.3.3)
|
25
25
|
addressable (~> 2.3, >= 2.3.4)
|
26
26
|
berkshelf-api-client (~> 2.0, >= 2.0.2)
|
@@ -56,31 +56,30 @@ GEM
|
|
56
56
|
celluloid-io (0.16.2)
|
57
57
|
celluloid (>= 0.16.0)
|
58
58
|
nio4r (>= 1.1.0)
|
59
|
-
chef (12.
|
60
|
-
chef-config (= 12.
|
61
|
-
chef-zero (~> 4.
|
59
|
+
chef (12.5.1)
|
60
|
+
chef-config (= 12.5.1)
|
61
|
+
chef-zero (~> 4.2, >= 4.2.2)
|
62
62
|
diff-lcs (~> 1.2, >= 1.2.4)
|
63
63
|
erubis (~> 2.7)
|
64
64
|
ffi-yajl (~> 2.2)
|
65
65
|
highline (~> 1.6, >= 1.6.9)
|
66
|
-
mixlib-authentication (~> 1.
|
66
|
+
mixlib-authentication (~> 1.3)
|
67
67
|
mixlib-cli (~> 1.4)
|
68
68
|
mixlib-log (~> 1.3)
|
69
69
|
mixlib-shellout (~> 2.0)
|
70
|
-
net-ssh (
|
70
|
+
net-ssh (~> 2.6)
|
71
71
|
net-ssh-multi (~> 1.1)
|
72
72
|
ohai (>= 8.6.0.alpha.1, < 9)
|
73
73
|
plist (~> 3.1.0)
|
74
|
-
|
75
|
-
rspec-core (~> 3.
|
76
|
-
rspec-expectations (~> 3.
|
77
|
-
rspec-mocks (~> 3.
|
74
|
+
pry (~> 0.9)
|
75
|
+
rspec-core (~> 3.2)
|
76
|
+
rspec-expectations (~> 3.2)
|
77
|
+
rspec-mocks (~> 3.2)
|
78
78
|
rspec_junit_formatter (~> 0.2.0)
|
79
79
|
serverspec (~> 2.7)
|
80
80
|
specinfra (~> 2.10)
|
81
81
|
syslog-logger (~> 1.6)
|
82
|
-
|
83
|
-
chef-config (12.7.2)
|
82
|
+
chef-config (12.5.1)
|
84
83
|
mixlib-config (~> 2.0)
|
85
84
|
mixlib-shellout (~> 2.0)
|
86
85
|
chef-zero (4.6.2)
|
@@ -90,6 +89,7 @@ GEM
|
|
90
89
|
rack
|
91
90
|
uuidtools (~> 2.1)
|
92
91
|
cleanroom (1.0.0)
|
92
|
+
coderay (1.1.1)
|
93
93
|
dep-selector-libgecode (1.2.0)
|
94
94
|
dep_selector (1.0.3)
|
95
95
|
dep-selector-libgecode (~> 1.0)
|
@@ -114,12 +114,10 @@ GEM
|
|
114
114
|
json (1.8.3)
|
115
115
|
json_pure (1.8.3)
|
116
116
|
libyajl2 (1.2.0)
|
117
|
+
method_source (0.8.2)
|
117
118
|
minitar (0.5.4)
|
118
|
-
mixlib-authentication (1.4.
|
119
|
+
mixlib-authentication (1.4.1)
|
119
120
|
mixlib-log
|
120
|
-
rspec-core (~> 3.2)
|
121
|
-
rspec-expectations (~> 3.2)
|
122
|
-
rspec-mocks (~> 3.2)
|
123
121
|
mixlib-cli (1.6.0)
|
124
122
|
mixlib-config (2.2.1)
|
125
123
|
mixlib-log (1.6.0)
|
@@ -129,7 +127,7 @@ GEM
|
|
129
127
|
multipart-post (2.0.0)
|
130
128
|
net-scp (1.2.1)
|
131
129
|
net-ssh (>= 2.6.5)
|
132
|
-
net-ssh (
|
130
|
+
net-ssh (2.9.4)
|
133
131
|
net-ssh-gateway (1.2.0)
|
134
132
|
net-ssh (>= 2.6.5)
|
135
133
|
net-ssh-multi (1.2.1)
|
@@ -155,7 +153,10 @@ GEM
|
|
155
153
|
ast (~> 2.2)
|
156
154
|
plist (3.1.0)
|
157
155
|
powerpack (0.1.1)
|
158
|
-
|
156
|
+
pry (0.10.3)
|
157
|
+
coderay (~> 1.1.0)
|
158
|
+
method_source (~> 0.8.1)
|
159
|
+
slop (~> 3.4)
|
159
160
|
rack (1.6.4)
|
160
161
|
rainbow (2.1.0)
|
161
162
|
rake (10.5.0)
|
@@ -214,6 +215,7 @@ GEM
|
|
214
215
|
rspec-its
|
215
216
|
specinfra (~> 2.53)
|
216
217
|
sfl (2.2)
|
218
|
+
slop (3.6.0)
|
217
219
|
solve (2.0.3)
|
218
220
|
molinillo (~> 0.4.2)
|
219
221
|
semverse (~> 1.1)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.7
|
data/lib/builderator/tasks.rb
CHANGED
@@ -74,8 +74,8 @@ module Builderator
|
|
74
74
|
prepare
|
75
75
|
|
76
76
|
invoke Tasks::Packer, :build, [profile], options
|
77
|
-
invoke Tasks::Packer, :remote_tag, [profile], options if options['remote_tag']
|
78
77
|
invoke Tasks::Packer, :copy, [profile], options if options['copy']
|
78
|
+
invoke Tasks::Packer, :remote_tag, [profile], options if options['remote_tag']
|
79
79
|
end
|
80
80
|
|
81
81
|
# desc 'cookbook SUBCOMMAND', 'Cookbook tasks'
|
@@ -133,35 +133,44 @@ module Builderator
|
|
133
133
|
def remote_tag(profile)
|
134
134
|
invoke :configure, [profile], options
|
135
135
|
|
136
|
-
sts_client = Aws::STS::Client.new(region: Config.aws.region)
|
137
136
|
allowed_cred_keys = %w(access_key_id secret_access_key session_token)
|
138
137
|
|
139
138
|
images.each do |image_name, (image, build)|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
139
|
+
ami_regions = build.ami_regions
|
140
|
+
ami_regions << Config.aws.region
|
141
|
+
ami_regions.uniq!
|
142
|
+
ami_regions.each do |region|
|
144
143
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
144
|
+
sts_client = Aws::STS::Client.new(region: region)
|
145
|
+
|
146
|
+
filters = [{
|
147
|
+
:name => 'name',
|
148
|
+
:values => [image_name]
|
149
|
+
}]
|
149
150
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
response = sts_client.assume_role( :role_arn => role_arn, :role_session_name => "tag-new-ami")
|
154
|
-
raise "Could not assume role [#{role_arn}]. Perhaps it does not exist?" unless response.successful?
|
155
|
-
rescue => e
|
156
|
-
say_status :skip, "Got error when trying to assume role: #{e.message} - continuing."
|
157
|
-
next
|
151
|
+
if build.tagging_role.nil?
|
152
|
+
say_status :complete, 'No remote tagging to be performed as no IAM role is defined'
|
153
|
+
return
|
158
154
|
end
|
159
155
|
|
160
|
-
|
156
|
+
regional_image = Util.ec2(region).describe_images(:filters => filters).images.first
|
161
157
|
|
162
|
-
|
163
|
-
|
164
|
-
|
158
|
+
build.ami_users.each do |account|
|
159
|
+
role_arn = "arn:aws:iam::#{account}:role/#{build.tagging_role}"
|
160
|
+
begin
|
161
|
+
response = sts_client.assume_role( :role_arn => role_arn, :role_session_name => "tag-new-ami")
|
162
|
+
raise "Could not assume role [#{role_arn}]. Perhaps it does not exist?" unless response.successful?
|
163
|
+
rescue => e
|
164
|
+
say_status :skip, "Got error when trying to assume role: #{e.message} - continuing."
|
165
|
+
next
|
166
|
+
end
|
167
|
+
|
168
|
+
creds_hash = response.credentials.to_h.keep_if { |k,v| allowed_cred_keys.include?(k.to_s) }
|
169
|
+
|
170
|
+
say_status :remote_tag, "Tag AMI #{image_name} (#{regional_image.image_id}) in #{region} (#{account})"
|
171
|
+
Util.ec2(region, creds_hash)
|
172
|
+
.create_tags(:dry_run => false, :resources => [regional_image.image_id], :tags => image.tags)
|
173
|
+
end
|
165
174
|
end
|
166
175
|
end
|
167
176
|
say_status :complete, 'Remote tagging complete'
|
data/rvm.env
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
declare -x GEM_HOME="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-
|
2
|
-
declare -x GEM_PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-
|
1
|
+
declare -x GEM_HOME="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-2"
|
2
|
+
declare -x GEM_PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-2:/home/jenkins/.rvm/gems/ruby-2.1.5@global"
|
3
3
|
declare -x HOME="/home/jenkins"
|
4
|
-
declare -x HUDSON_COOKIE="
|
4
|
+
declare -x HUDSON_COOKIE="e18797dc-72cf-4e64-9f78-1a26e5fe5703"
|
5
5
|
declare -x IRBRC="/home/jenkins/.rvm/rubies/ruby-2.1.5/.irbrc"
|
6
6
|
declare -x LANG="en_US.UTF-8"
|
7
7
|
declare -x LC_ALL="en_US.UTF-8"
|
8
8
|
declare -x MY_RUBY_HOME="/home/jenkins/.rvm/rubies/ruby-2.1.5"
|
9
9
|
declare -x NLSPATH="/usr/dt/lib/nls/msg/%L/%N.cat"
|
10
10
|
declare -x OLDPWD
|
11
|
-
declare -x PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-
|
11
|
+
declare -x PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-2/bin:/home/jenkins/.rvm/gems/ruby-2.1.5@global/bin:/home/jenkins/.rvm/rubies/ruby-2.1.5/bin:/home/jenkins/.rvm/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin"
|
12
12
|
declare -x PWD="/home/jenkins/workspace/gem-public-builderator-master"
|
13
13
|
declare -x RUBY_VERSION="ruby-2.1.5"
|
14
14
|
declare -x SHLVL="1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: builderator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Manero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|