cloudspin-stack 0.1.9 → 0.1.10

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: 5e178ce62e9a31330889dc2267257be6ed7ad348
4
- data.tar.gz: ebc785974df577a49b9397576e1b8b837683ad19
3
+ metadata.gz: a77954b28811b4e70c3b68e38ec4aa222da97576
4
+ data.tar.gz: 7d2e8ff6082d11293d69bf87890701c0da1b02c6
5
5
  SHA512:
6
- metadata.gz: '09ed7657a6cd3b3768d152b54d9f6388f3b737edc320b19edc2ddb7588181301fd3cea4c50bbe5997e190f6773e994e2910e945f91b1a8992cb9174846ff24f4'
7
- data.tar.gz: 9ee0318f4c9eb5452ea459a18314b80fce67b4e4c46531b929af5a99066ce1518212d025f2a2f70175840998b4c7334a4509010c257579b152de1975561148a2
6
+ metadata.gz: 0d21bea647d8da42838070efa33d2ff2462f386c71b3d554e22485accc48ddc943436e1a615eab549e27a1244120340542b470d8c1b3f3d9720626aad154e062
7
+ data.tar.gz: d794ab498fcdb482ad0013ae5f0a0730a27e5828117c161a8f9bfc8771720124096fbece73d4fe15cc26ece1eb69fd9c1543b520059e91ffff07a0d2ca5556f9
data/lib/cloudspin/cli.rb CHANGED
@@ -83,6 +83,7 @@ module Cloudspin
83
83
  options[:file].each { |config_file|
84
84
  stack.add_config_from_yaml(config_file)
85
85
  }
86
+ stack.add_parameter_values({ :deployment_identifier => id })
86
87
  stack
87
88
  end
88
89
 
@@ -30,6 +30,16 @@ module Cloudspin
30
30
  @resource_values = {}
31
31
  end
32
32
 
33
+ def self.from_definition_folder(id:, definition_folder:, instance_folder: '.')
34
+ self.new(
35
+ id: id,
36
+ stack_definition: Definition.from_file(definition_folder + '/stack.yaml'),
37
+ backend_config: {},
38
+ working_folder: instance_folder + '/work',
39
+ statefile_folder: instance_folder + '/state'
40
+ )
41
+ end
42
+
33
43
  def validate_id(raw_id)
34
44
  raise "Stack instance ID '#{raw_id}' won't work. It needs to work as a filename." if /[^0-9A-Za-z.\-\_]/ =~ raw_id
35
45
  raise "Stack instance ID '#{raw_id}' won't work. No double dots allowed." if /\.\./ =~ raw_id
@@ -45,11 +55,20 @@ module Cloudspin
45
55
  end
46
56
 
47
57
  def add_config_from_yaml(yaml_file)
48
- config = YAML.load_file(yaml_file) || {}
58
+ config = load_config_file(yaml_file)
49
59
  add_parameter_values(config['parameters']) if config['parameters']
50
60
  add_resource_values(config['resources']) if config['resources']
51
61
  end
52
62
 
63
+ def load_config_file(yaml_file)
64
+ if File.exists?(yaml_file)
65
+ YAML.load_file(yaml_file) || {}
66
+ else
67
+ {}
68
+ end
69
+ end
70
+
71
+
53
72
  def plan(plan_destroy: false)
54
73
  RubyTerraform.clean(directory: working_folder)
55
74
  mkdir_p File.dirname(working_folder)
@@ -1,5 +1,5 @@
1
1
  module Cloudspin
2
2
  module Stack
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudspin-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kief '
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-terraform