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 +4 -4
- data/lib/cloudspin/cli.rb +26 -16
- data/lib/cloudspin/stack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e42299e2c0243036553c2f748348f9ab2d459a5
|
4
|
+
data.tar.gz: c07378a6cf093be520bc4b969dd4d566f03f313b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2051d8c1761565413f4a1ea9e689cf544e25e388ddd9abf30c817c5b4aa4bcf012e8cabcd3ff0d5f1d81b745374bfefcbc7b12f425cf3b33602126fc2ac10d95
|
7
|
+
data.tar.gz: b6e89ba95bbecd7a94248fdcce690c21379fce7b11e57b8a574ad97ea274340c2219b33af8cb580694251cef33c907f872828566da0f626f5ba4e1b49a50f01c
|
data/lib/cloudspin/cli.rb
CHANGED
@@ -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
|
13
|
+
:desc => 'A list of stack instance configuration files. Values in files listed later override those from earlier files.'
|
14
14
|
|
15
|
-
class_option :
|
16
|
-
:aliases => '-
|
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 :
|
22
|
-
:aliases => '-
|
23
|
-
:banner => '
|
24
|
-
:
|
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
|
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
|
-
|
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?
|