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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 571c2d443cf0c6bf204e6d2ed8270f5469c9c0fb
4
- data.tar.gz: 7216ee563207e6902fd00aa7c937c1d1b27b7d30
3
+ metadata.gz: 1065b79854aadadb2e8a3c67d384a1e0eb25937a
4
+ data.tar.gz: 67ee179bff193c718593eaaf1dd38f62895aafd5
5
5
  SHA512:
6
- metadata.gz: 23a3435a531c0fc39fbb00e5b9a182c66f689a2df92f9c1b84fcc25301865624cf9b7fd2994df3f66f9da1883ff2f5808a3056e20299909d568c228c33613f5a
7
- data.tar.gz: 365b4ae71e23a0232ea7a15a6dceee2d2e7882d9e82acdbb1068c8bd628cb5f537af52e680a0ba97a5642e76b6cfb44192f0c2c05eb97d37bd85f968e404318e
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
- puts "Get configuration from #{options[:file]}" if options[:file]
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: working_folder,
40
- statefile_folder: 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(terraform_source_folder + '/stack.yaml')
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
@@ -1,5 +1,5 @@
1
1
  module Cloudspin
2
2
  module Stack
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kief '