opzworks 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ceb825f2ff952211a19939007467e3e08b253159
4
- data.tar.gz: fdb27f9eec43d7c0c58e54213088c3346368dc69
3
+ metadata.gz: ab1543fcedf335dd55bf202dcce00c00876ece4d
4
+ data.tar.gz: 823d039d9ce4c93e9040ce1aadaae9289ccd8e67
5
5
  SHA512:
6
- metadata.gz: ffea248fe7461455233b525a8b000324714ba69fd69999cc98bec9d451a81c20a0fc4bee98759b07d62ba601c0da2f2ccb004cff97591f76eea5690dcd86cc91
7
- data.tar.gz: 88ff9887fd1584d3028c1f4a262120e6e31ab152f930bb4418bd0ce3486c682b219d52e92e9b2f31c3cafe467f64e4e7c57fa2acc82cb0a16f5ad0dd18a26867
6
+ metadata.gz: f07a659564cf9763deb42b7db455613af2c2419b6a2853ce383fdaa2cd1f0ea720f2fecf54d3d16f154f11ef8e22ab7b4e725632568b01dec582194cffa2ad3a
7
+ data.tar.gz: 6418a9b09e65017e708dd71271b4d33210556737f66bdb7f1e8ed9f864a333fd96301ded9b043732855c1952cfab02cef5a6e0622807bfcc17785192e408db2c
data/CHANGELOG.md CHANGED
@@ -1,16 +1,21 @@
1
1
  changelog
2
2
  =========
3
3
 
4
+ 0.10.0
5
+ ------
6
+ * allow override of default [opzworks] config block via ENV var: `OPZWORKS_PROFILE`
7
+ * better error handling if passed a missing `AWS_PROFILE`
8
+
4
9
  0.9.0
5
10
  -----
6
11
  * allow updating only specific cookbooks in the berkshelf: when passing the `-u` update flag, you can now also specify a space delimited list of cookbooks following a `-c` switch (`-u` alone will continue to run `berks update` for the entire berksfile):
7
12
 
8
- e.g. `opzworks berks -u -c mapzen_transitland sensu`
13
+ e.g. `opzworks berks transitland::d -u -c mapzen_transitland sensu`
9
14
 
10
15
  0.8.0
11
16
  -----
12
17
  * change in behavior: `berks update` is now no longer the default, and will be skipped unless the --update flag is passed explicitly. This is to prevent unwanted updating of unpinned cookbooks. However, you must now be sure to pass --update when the situation requires it.
13
- * to all the short option of -u for `berks update`, the `update_custom_cookbooks` flag is now -ucc
18
+ * to allow the short option of -u for `berks update`, the `update_custom_cookbooks` flag is now -ucc
14
19
 
15
20
  0.7.3
16
21
  -----
@@ -28,7 +28,7 @@ module OpzWorks
28
28
  EOS
29
29
  opt :ucc, 'Trigger update_custom_cookbooks on stack after uploading a new cookbook tarball.', default: true
30
30
  opt :update, 'Run berks update before packaging the Berkshelf.', default: false, short: 'u'
31
- opt :cookbooks, 'Run berks update only for the specified cookbooks', type: :strings, default: nil, short: 'c'
31
+ opt :cookbooks, 'Run berks update only for the specified cookbooks (requires -u)', type: :strings, default: nil, short: 'c'
32
32
  opt :clone, 'Only clone the management repo, then exit.', default: false
33
33
  end
34
34
  ARGV.empty? ? Trollop.die('no stacks specified') : false
@@ -84,17 +84,17 @@ module OpzWorks
84
84
  end
85
85
 
86
86
  if options[:update] == true
87
- unless options[:cookbooks].nil?
88
- puts "\nUpdating the berkshelf for cookbook(s) ".foreground(:blue) + "#{options[:cookbooks].join(', ')}".foreground(:green)
87
+ if options[:cookbooks].nil?
88
+ puts "\nUpdating the berkshelf".foreground(:blue)
89
89
  run_local <<-BASH
90
90
  cd #{@target_path}
91
- berks update #{options[:cookbooks].join(' ')}
91
+ berks update
92
92
  BASH
93
93
  else
94
- puts "\nUpdating the berkshelf".foreground(:blue)
94
+ puts "\nUpdating the berkshelf for cookbook(s): ".foreground(:blue) + options[:cookbooks].join(', ').to_s.foreground(:green)
95
95
  run_local <<-BASH
96
96
  cd #{@target_path}
97
- berks update
97
+ berks update #{options[:cookbooks].join(' ')}
98
98
  BASH
99
99
  end
100
100
  else
@@ -17,24 +17,26 @@ module OpzWorks
17
17
  abort "Config file #{file} not found, exiting!".foreground(:red) unless File.exist? file
18
18
  ini = IniFile.load(file)
19
19
 
20
- abort "Could not find [opzworks] config block in #{file}, exiting!".foreground(:red) if ini['opzworks'].empty?
20
+ @opzworks_profile = ENV['OPZWORKS_PROFILE'] || 'opzworks'
21
+ abort "Could not find [#{@opzworks_profile}] config block in #{file}, exiting!".foreground(:red) if ini[@opzworks_profile].empty?
21
22
 
22
23
  # set the region and the profile we want to pick up from ~/.aws/credentials
23
24
  @aws_profile = ENV['AWS_PROFILE'] || 'default'
25
+ abort "Could not find [#{@aws_profile}] config block in #{file}, exiting!".foreground(:red) if ini[@aws_profile].empty?
24
26
  @aws_region = ENV['AWS_REGION'] || ini[@aws_profile]['region']
25
27
 
26
28
  @ssh_user_name =
27
- ini['opzworks']['ssh-user-name'].strip unless ini['opzworks']['ssh-user-name'].nil?
29
+ ini[@opzworks_profile]['ssh-user-name'].strip unless ini[@opzworks_profile]['ssh-user-name'].nil?
28
30
  @berks_repository_path =
29
- ini['opzworks']['berks-repository-path'].strip unless ini['opzworks']['berks-repository-path'].nil?
31
+ ini[@opzworks_profile]['berks-repository-path'].strip unless ini[@opzworks_profile]['berks-repository-path'].nil?
30
32
  @berks_base_path =
31
- ini['opzworks']['berks-base-path'].strip unless ini['opzworks']['berks-base-path'].nil?
33
+ ini[@opzworks_profile]['berks-base-path'].strip unless ini[@opzworks_profile]['berks-base-path'].nil?
32
34
  @berks_s3_bucket =
33
- ini['opzworks']['berks-s3-bucket'].strip unless ini['opzworks']['berks-s3-bucket'].nil?
35
+ ini[@opzworks_profile]['berks-s3-bucket'].strip unless ini[@opzworks_profile]['berks-s3-bucket'].nil?
34
36
  @berks_tarball_name =
35
- ini['opzworks']['berks-tarball-name'].strip unless ini['opzworks']['berks-tarball-name'].nil?
37
+ ini[@opzworks_profile]['berks-tarball-name'].strip unless ini[@opzworks_profile]['berks-tarball-name'].nil?
36
38
  @berks_github_org =
37
- ini['opzworks']['berks-github-org'].strip unless ini['opzworks']['berks-github-org'].nil?
39
+ ini[@opzworks_profile]['berks-github-org'].strip unless ini[@opzworks_profile]['berks-github-org'].nil?
38
40
  end
39
41
  end
40
42
  end
data/lib/opzworks/meta.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module OpzWorks
3
- VERSION = '0.9.0'.freeze
3
+ VERSION = '0.10.0'.freeze
4
4
  AUTHORS = ['Grant Heffernan', 'Mapzen'].freeze
5
5
  EMAIL = ['grant@mapzen.com'].freeze
6
6
  DESCRIPTION = 'OpzWorks Utilities'.freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opzworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Heffernan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-22 00:00:00.000000000 Z
12
+ date: 2016-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk