cloudspin-stack 0.1.4 → 0.1.5
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 +28 -26
- 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: 1065b79854aadadb2e8a3c67d384a1e0eb25937a
|
4
|
+
data.tar.gz: 67ee179bff193c718593eaaf1dd38f62895aafd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb673c43a94c97398cbf62ef3bb32158a20d30ab9ad720d1f80d54891166d88f1a406a36eed8929e72f7d69be5dc99b48501f3fbfb90abe04eece1ee76d58dd
|
7
|
+
data.tar.gz: b1781e0d8c1d5c82d04711b096dd18e0d8d0dbc7d2cc90cebdaff2d6227ba17ebde9f3d1b743e029945c522882b375401a234542a536e4d7f8249b391465f256
|
data/lib/cloudspin/cli.rb
CHANGED
@@ -5,19 +5,33 @@ module Cloudspin
|
|
5
5
|
class CLI < Thor
|
6
6
|
|
7
7
|
class_option :file,
|
8
|
+
:aliases => '-f',
|
8
9
|
:banner => 'YAML-CONFIG-FILE',
|
9
10
|
:type => :array,
|
10
11
|
:default => [ 'spin-default.yaml', 'spin-local.yaml' ],
|
11
12
|
:desc => 'A list of configuration files to load for the stack instance. Values in files listed later override those from earlier files.'
|
12
13
|
|
14
|
+
class_option :terraform_source,
|
15
|
+
:aliases => '-t',
|
16
|
+
:banner => 'PATH',
|
17
|
+
:default => './src',
|
18
|
+
:desc => 'Folder with the terraform project source files'
|
19
|
+
|
20
|
+
class_option :work,
|
21
|
+
:aliases => '-w',
|
22
|
+
:banner => 'PATH',
|
23
|
+
:default => './work',
|
24
|
+
:desc => 'Folder to create and copy working files into'
|
25
|
+
|
26
|
+
class_option :state,
|
27
|
+
:aliases => '-s',
|
28
|
+
:banner => 'PATH',
|
29
|
+
:default => './state',
|
30
|
+
:desc => 'Folder to create and store local state'
|
31
|
+
|
13
32
|
desc 'plan', 'Print the changes that will by applied when the \'stack up\' command is run'
|
14
33
|
def plan
|
15
|
-
|
16
|
-
stack = instance
|
17
|
-
options[:file].each { |config_file|
|
18
|
-
stack.add_config_from_yaml(config_file)
|
19
|
-
}
|
20
|
-
stack.plan
|
34
|
+
instance.plan
|
21
35
|
end
|
22
36
|
|
23
37
|
desc 'version', 'Print the version number'
|
@@ -33,32 +47,20 @@ module Cloudspin
|
|
33
47
|
no_commands do
|
34
48
|
|
35
49
|
def instance
|
36
|
-
Cloudspin::Stack::Instance.new(
|
50
|
+
stack = Cloudspin::Stack::Instance.new(
|
37
51
|
stack_definition: stack_definition,
|
38
52
|
backend_config: {},
|
39
|
-
working_folder:
|
40
|
-
statefile_folder:
|
53
|
+
working_folder: options[:work],
|
54
|
+
statefile_folder: options[:state]
|
41
55
|
)
|
56
|
+
options[:file].each { |config_file|
|
57
|
+
stack.add_config_from_yaml(config_file)
|
58
|
+
}
|
59
|
+
stack
|
42
60
|
end
|
43
61
|
|
44
62
|
def stack_definition
|
45
|
-
Cloudspin::Stack::Definition.from_file(
|
46
|
-
end
|
47
|
-
|
48
|
-
def stack_project_folder
|
49
|
-
Pathname.new(Dir.pwd).realpath.to_s
|
50
|
-
end
|
51
|
-
|
52
|
-
def terraform_source_folder
|
53
|
-
Pathname.new(stack_project_folder + '/src').realpath.to_s
|
54
|
-
end
|
55
|
-
|
56
|
-
def working_folder
|
57
|
-
Pathname.new(stack_project_folder + '/work').realpath.to_s
|
58
|
-
end
|
59
|
-
|
60
|
-
def statefile_folder
|
61
|
-
Pathname.new(stack_project_folder + '/state').realpath.to_s
|
63
|
+
Cloudspin::Stack::Definition.from_file(options[:terraform_source] + '/stack.yaml')
|
62
64
|
end
|
63
65
|
|
64
66
|
end
|