ops_build 1.1.0 → 1.1.1

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: 75752053b417d9c74d7d2ab6bd2072f2847d403a
4
- data.tar.gz: 68b39a5adbc7ba53c8e548ab18449db28eecf9b5
3
+ metadata.gz: c8d88abeedd970f66096623b4ad1c7b91b284565
4
+ data.tar.gz: 1a6db5c8f8c54c9e616475911577f0465399f1e8
5
5
  SHA512:
6
- metadata.gz: c174cf62071c344e2feab44acc79dbb8ce9972caefc6df2007a9fbde4cc03f981d050d58ca3d7a2d294056cd8c8038d9a33bcfebe147cc22f72d64b0fc1f555d
7
- data.tar.gz: 86cbdcf58832e01d8a2d9beb17cf5f1f1a7a2e94af87c35bbc5e76aa8490bfb1e06e30666ad651e801944b7291261daf8c50089d45a05867a266ea7bc99e32d9
6
+ metadata.gz: f215bc89ff8da7d9175f63bbeb0b6965e9656d51f642a99f03af60d9b8db0377f88acdaf3ce4d956bba2074fa95f387482e0c5c675d9906280089ed134c1a88d
7
+ data.tar.gz: 252807b1a0258f987a26aa943291eec37a4833840719612ace602edf845f1cea2f8c2679fd5da1012ec3468c54ccfc3c0cdf5cb4b0113da4c222fd28a3c5ae44
@@ -5,6 +5,7 @@ module OpsBuild
5
5
  option :ec2_region, type: :string, aliases: '-R', desc: 'AWS EC2 region', default: 'us-east-1'
6
6
  option :aws_access, type: :string, aliases: '-A', desc: 'AWS Access key'
7
7
  option :aws_secret, type: :string, aliases: '-S', desc: 'AWS Secret key'
8
+ option :params, type: :string, aliases: '-p', desc: 'path to JSON as params'
8
9
  end
9
10
 
10
11
  desc 'packer TEMPLATE', 'build packer template'
@@ -15,6 +16,9 @@ module OpsBuild
15
16
  berkshelf = Berkshelf.new(dir: options[:berk_dir], silent: false)
16
17
  # aws = Aws.new
17
18
 
19
+ raise "JSON #{options[:params]} not found!" unless File.exists?(options[:params])
20
+ params = JSON.parse(File.read(options[:params]), symbolize_names: true)
21
+
18
22
  OpsBuild.logger.info("Building VM using packer from template #{template}")
19
23
 
20
24
  # aws_access_key = options[:aws_access] || aws.aws_get_access_key
@@ -34,6 +38,7 @@ module OpsBuild
34
38
  packer.add_user_variable(:aws_secret_key, aws_secret_key) if aws_secret_key
35
39
  packer.add_user_variable(:aws_region, aws_region) if aws_region
36
40
  packer.add_user_variable(:cookbook_path, berkshelf.dir)
41
+ params.each { |k, v| packer.add_user_variable(k, v) }
37
42
 
38
43
  begin
39
44
  # Install missing cookbooks
@@ -14,7 +14,7 @@ module OpsBuild
14
14
  # Add name/value pair to users_vars hash which is going to be used later for packer var-file
15
15
  def add_user_variable(name, value)
16
16
  unless name.nil? and value.nil?
17
- @user_vars[name] = value
17
+ @user_vars[name.to_sym] = value
18
18
  end
19
19
  end
20
20
 
@@ -1,3 +1,3 @@
1
1
  module OpsBuild
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HAMSIK Adam
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.4.5
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: RSD Devops related build tool to run packer, berkshelf