terragov 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/terragov +1 -1
- data/lib/terragov.rb +1 -4
- data/lib/terragov/cli.rb +11 -8
- data/lib/terragov/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: 87f96c82addb19f7bef1a8cfe8d13f6ae8e4934a
|
4
|
+
data.tar.gz: 4e3c853e0546749ba0d540b47914362ab866bf65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d28c592c38238cb6d3276771689fa5079727f9f95505a82de7be36a5281eab71617cac21c7dc88a89c0e26896f1995612dc4086a7e79646eb17f1d9d2d2e62
|
7
|
+
data.tar.gz: 189846a9f1ed46f1c790b5b5ca79725d46b85ac166467c45aad8566a2e5e6d0f818dc5110fd01bfbf905710e2cd5fb4254f94c5d5ac0035f91e72f9aba627067
|
data/bin/terragov
CHANGED
data/lib/terragov.rb
CHANGED
data/lib/terragov/cli.rb
CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
|
|
3
3
|
require_relative 'buildpaths'
|
4
4
|
require_relative 'terraform'
|
5
5
|
require_relative 'cleaner'
|
6
|
+
require_relative 'version'
|
6
7
|
|
7
8
|
module Terragov
|
8
9
|
class Cli
|
@@ -21,8 +22,8 @@ module Terragov
|
|
21
22
|
$data_dir = data_dir
|
22
23
|
end
|
23
24
|
|
24
|
-
global_option( '-e', '--
|
25
|
-
$environment =
|
25
|
+
global_option( '-e', '--environment STRING', String, 'Select environment') do |environment|
|
26
|
+
$environment = environment
|
26
27
|
end
|
27
28
|
|
28
29
|
global_option( '-p', '--project STRING', String, 'Name of the project') do |project|
|
@@ -55,8 +56,10 @@ module Terragov
|
|
55
56
|
if $config_file || ENV['TERRAGOV_CONFIG_FILE']
|
56
57
|
file = $config_file || ENV['TERRAGOV_CONFIG_FILE']
|
57
58
|
$values = YAML.load_file(File.expand_path(file))
|
59
|
+
return $values
|
60
|
+
else
|
61
|
+
return false
|
58
62
|
end
|
59
|
-
return $values
|
60
63
|
end
|
61
64
|
|
62
65
|
def data_dir
|
@@ -65,7 +68,7 @@ module Terragov
|
|
65
68
|
return File.expand_path($data_dir)
|
66
69
|
elsif ENV['TERRAGOV_DATA_DIR']
|
67
70
|
return File.expand_path(ENV['TERRAGOV_DATA_DIR'])
|
68
|
-
elsif load_config_file
|
71
|
+
elsif load_config_file
|
69
72
|
return File.expand_path(load_config_file['data_dir'])
|
70
73
|
else
|
71
74
|
abort(error_message)
|
@@ -78,7 +81,7 @@ module Terragov
|
|
78
81
|
return $environment
|
79
82
|
elsif ENV['TERRAGOV_ENVIRONMENT']
|
80
83
|
return ENV['TERRAGOV_ENVIRONMENT']
|
81
|
-
elsif load_config_file
|
84
|
+
elsif load_config_file
|
82
85
|
return load_config_file['environment']
|
83
86
|
else
|
84
87
|
abort(error_message)
|
@@ -92,7 +95,7 @@ module Terragov
|
|
92
95
|
return $project
|
93
96
|
elsif ENV['TERRAGOV_PROJECT']
|
94
97
|
return ENV['TERRAGOV_PROJECT']
|
95
|
-
elsif load_config_file
|
98
|
+
elsif load_config_file
|
96
99
|
return load_config_file['project']
|
97
100
|
else
|
98
101
|
abort(error_message)
|
@@ -105,7 +108,7 @@ module Terragov
|
|
105
108
|
return File.expand_path($repo_dir)
|
106
109
|
elsif ENV['TERRAGOV_REPO_DIR']
|
107
110
|
return File.expand_path(ENV['TERRAGOV_REPO_DIR'])
|
108
|
-
elsif load_config_file
|
111
|
+
elsif load_config_file
|
109
112
|
return File.expand_path(load_config_file['repo_dir'])
|
110
113
|
else
|
111
114
|
return File.expand_path('.')
|
@@ -119,7 +122,7 @@ module Terragov
|
|
119
122
|
return $stack
|
120
123
|
elsif ENV['TERRAGOV_STACK']
|
121
124
|
return ENV['TERRAGOV_STACK']
|
122
|
-
elsif load_config_file
|
125
|
+
elsif load_config_file
|
123
126
|
return load_config_file['stack']
|
124
127
|
else
|
125
128
|
abort(error_message)
|
data/lib/terragov/version.rb
CHANGED