cloudspin-stack 0.1.16 → 0.1.17

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: 6270c0e9737073233d8762c0b9ba46f1705ae47d
4
- data.tar.gz: a47fa583aa4bed7df2b768426724dfa278871074
3
+ metadata.gz: 6e42299e2c0243036553c2f748348f9ab2d459a5
4
+ data.tar.gz: c07378a6cf093be520bc4b969dd4d566f03f313b
5
5
  SHA512:
6
- metadata.gz: 3d0add6911d011e494c8b9270383adc5001c6e08f316b2e0c14ebcaa2141637073162319ed22bbf9bcf081039c8ecaa138e031f062cbf54ef4a59fe09d9fc61f
7
- data.tar.gz: 49e34de90b325df00c5bc791db6612823883c1a52375c6525104a01ee124be013164fa13bd3214a5504c24d59bcf546860db3ea038d5e4d9d3a6baee04911893
6
+ metadata.gz: 2051d8c1761565413f4a1ea9e689cf544e25e388ddd9abf30c817c5b4aa4bcf012e8cabcd3ff0d5f1d81b745374bfefcbc7b12f425cf3b33602126fc2ac10d95
7
+ data.tar.gz: b6e89ba95bbecd7a94248fdcce690c21379fce7b11e57b8a574ad97ea274340c2219b33af8cb580694251cef33c907f872828566da0f626f5ba4e1b49a50f01c
@@ -10,25 +10,18 @@ module Cloudspin
10
10
  :banner => 'YAML-CONFIG-FILE',
11
11
  :type => :array,
12
12
  :default => ['stack-instance-defaults.yaml', 'stack-instance-local.yaml'],
13
- :desc => 'A list of configuration files to load for the stack instance. Values in files listed later override those from earlier files.'
13
+ :desc => 'A list of stack instance configuration files. Values in files listed later override those from earlier files.'
14
14
 
15
- class_option :terraform_source,
16
- :aliases => '-t',
15
+ class_option :source,
16
+ :aliases => '-s',
17
17
  :banner => 'PATH',
18
18
  :default => './src',
19
19
  :desc => 'Folder with the terraform project source files'
20
20
 
21
- class_option :work,
22
- :aliases => '-w',
23
- :banner => 'PATH',
24
- :default => './work',
25
- :desc => 'Folder to create and copy working files into'
26
-
27
- class_option :state,
28
- :aliases => '-s',
29
- :banner => 'PATH',
30
- :default => './state',
31
- :desc => 'Folder to create and store local state'
21
+ class_option :environment,
22
+ :aliases => '-e',
23
+ :banner => 'YAML-CONFIG-FILE',
24
+ :desc => 'An environment instance to manage.'
32
25
 
33
26
  desc 'up', 'Create or update the stack instance'
34
27
  option :dry, :type => :boolean, :default => false
@@ -67,14 +60,14 @@ module Cloudspin
67
60
 
68
61
  desc 'info', 'Print some info about arguments, for debugging'
69
62
  def info
70
- puts "Configuration file: #{options[:file]}"
63
+ puts "Configuration files: #{instance_configuration_files}"
71
64
  end
72
65
 
73
66
  no_commands do
74
67
 
75
68
  def instance
76
69
  Cloudspin::Stack::Instance.from_files(
77
- options[:file],
70
+ instance_configuration_files,
78
71
  stack_definition: stack_definition,
79
72
  backend_config: {},
80
73
  working_folder: options[:work],
@@ -86,6 +79,23 @@ module Cloudspin
86
79
  Cloudspin::Stack::Definition.from_file(options[:terraform_source] + '/stack-definition.yaml')
87
80
  end
88
81
 
82
+ def instance_configuration_files
83
+ file_list = options[:file]
84
+ if options[:environment]
85
+ if File.exists? environment_config_file
86
+ file_list << environment_config_file
87
+ else
88
+ $stderr.puts "Missing configuration file for environment #{options[:environment]} (#{environment_config_file})"
89
+ exit 1
90
+ end
91
+ end
92
+ file_list
93
+ end
94
+
95
+ def environment_config_file
96
+ Pathname.new("./environments/stack-instance-#{options[:environment]}.yaml").realdirpath.to_s
97
+ end
98
+
89
99
  end
90
100
 
91
101
  def self.exit_on_failure?
@@ -1,5 +1,5 @@
1
1
  module Cloudspin
2
2
  module Stack
3
- VERSION = '0.1.16'
3
+ VERSION = '0.1.17'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudspin-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kief '