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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec9b3b99b02e2e735e33bbc78da82f65a502f579
4
- data.tar.gz: 9ec84828b5d15e715f93844328610adf09bcae7f
3
+ metadata.gz: 89e14c2393d87e5b4a95b6e08442efde1b56a3d2
4
+ data.tar.gz: 5c0e467fc4f9228e7d2c981ecd607c1659072d7f
5
5
  SHA512:
6
- metadata.gz: 9dc75e1de4d13342c15fb5f88bdfa11035aa38f884b4bf2ba94ac719a6f15139d808d6ea849896d840cc536010745c6c1d43dfef90f715f4443939932dc5f65c
7
- data.tar.gz: e55a662292f305a923d1191e20ed7d2a80d91dc55d43858c9c6bb3488ef63f845ca6545745c07d5991e72742f83e6aeec51b95138d2e4ff54bdf64f4a99c8b39
6
+ metadata.gz: 87cb9385e02b95d9672ab4fceb21bd905b27e6aeaa142d317e3ef182888851999e0db0400703a86d6d65b2934567715a4509222f701b62cd5097bc866d31254a
7
+ data.tar.gz: 0448ea00eb5a00064975a18df49d468e17da249b2eb8cf48ea52109ff0136c8c4b194ffa0bfb2bf2ebddcff2953130e469936a4322412d937a98ab5f69f9a2d0
@@ -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.11)
19
- aws-sdk-resources (= 2.3.11)
20
- aws-sdk-core (2.3.11)
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.11)
23
- aws-sdk-core (= 2.3.11)
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.7.2)
60
- chef-config (= 12.7.2)
61
- chef-zero (~> 4.5)
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.4)
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 (>= 2.9, < 4.0)
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
- proxifier (~> 1.0)
75
- rspec-core (~> 3.4)
76
- rspec-expectations (~> 3.4)
77
- rspec-mocks (~> 3.4)
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
- uuidtools (~> 2.1.5)
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.0)
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 (3.1.1)
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
- proxifier (1.0.3)
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.6
1
+ 1.1.7
@@ -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
- filters = [{
141
- :name => 'name',
142
- :values => [image_name]
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
- if build.tagging_role.nil?
146
- say_status :complete, 'No remote tagging to be performed as no IAM role is defined'
147
- return
148
- end
144
+ sts_client = Aws::STS::Client.new(region: region)
145
+
146
+ filters = [{
147
+ :name => 'name',
148
+ :values => [image_name]
149
+ }]
149
150
 
150
- build.ami_users.each do |account|
151
- role_arn = "arn:aws:iam::#{account}:role/#{build.tagging_role}"
152
- begin
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
- creds_hash = response.credentials.to_h.keep_if { |k,v| allowed_cred_keys.include?(k.to_s) }
156
+ regional_image = Util.ec2(region).describe_images(:filters => filters).images.first
161
157
 
162
- say_status :remote_tag, "Tag AMI #{image_name} (#{image.image_id}) in account #{account}"
163
- Util.ec2(Config.aws.region, creds_hash)
164
- .create_tags(:dry_run => false, :resources => [image.image_id], :tags => image.tags)
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-3"
2
- declare -x GEM_PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-3:/home/jenkins/.rvm/gems/ruby-2.1.5@global"
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="e12399cc-9dd6-47e7-8fea-246675a1fc27"
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-3/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"
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.6
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-07 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake