sistero 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sistero +5 -1
- data/lib/sistero/config.rb +16 -3
- data/lib/sistero/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: e493aa279919d567e6a6eb2d0980dcd3ec412374
|
4
|
+
data.tar.gz: f222d218205101e767a903382b34928636e3a5cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04e07114fafb07c5ca60ec829c9c7664cab53c6d7783bd4fecd38a8da8e79334cbf4c32569f34daad8b7f08b363cda31f1ae4b3dcb450054403381966d37dc0f
|
7
|
+
data.tar.gz: 16799fcaa0100ae937347ca44eb52d4d6cc5a76ae9a952acb04eba4711e24320a8fa891fbbe2c8ab40ebb91d6515e2b0d87e1e121ea4ddeb424397e3551da630
|
data/bin/sistero
CHANGED
@@ -22,6 +22,7 @@ module Sistero::Command
|
|
22
22
|
end
|
23
23
|
|
24
24
|
op.on '-c', '--config file', 'override path to config file', 'cfg_file_path'
|
25
|
+
op.on '-d', '--directory dir', 'set working dir', 'directory'
|
25
26
|
|
26
27
|
op.subcommand 'ssh [vm]', 'ssh to vm' do |subop|
|
27
28
|
subop.on '-o val', 'add ssh options', 'ssh_options'
|
@@ -48,7 +49,10 @@ module Sistero::Command
|
|
48
49
|
end
|
49
50
|
|
50
51
|
command_cfg = OpenStruct.new config[command]
|
51
|
-
sistero = Sistero::Instance.new({
|
52
|
+
sistero = Sistero::Instance.new({
|
53
|
+
cfg_file_path: config.cfg_file_path,
|
54
|
+
directory: config.directory
|
55
|
+
})
|
52
56
|
|
53
57
|
case command
|
54
58
|
when 'ssh'
|
data/lib/sistero/config.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "yaml"
|
2
|
-
APP_NAME = "sistero"
|
3
2
|
|
4
3
|
module Sistero
|
4
|
+
CONFIG_FILE_NAME = 'sistero.yaml'
|
5
|
+
APP_NAME = "sistero"
|
6
|
+
|
5
7
|
VM_KEYS = [:name, :size, :region, :image, :access_token, :user_data, :private_networking,
|
6
8
|
:ssh_keys, :ssh_options, :ssh_user ]
|
7
9
|
|
@@ -36,8 +38,19 @@ module Sistero
|
|
36
38
|
# read defaults from config file
|
37
39
|
@cfg_file_path = opts[:cfg_file_path]
|
38
40
|
unless @cfg_file_path
|
39
|
-
|
40
|
-
|
41
|
+
directory = opts[:directory] || '.'
|
42
|
+
|
43
|
+
for n in 0..100
|
44
|
+
cfg_file_path = File.join(directory, CONFIG_FILE_NAME)
|
45
|
+
if File.exists? cfg_file_path
|
46
|
+
@cfg_file_path = cfg_file_path
|
47
|
+
break
|
48
|
+
end
|
49
|
+
directory = File.dirname directory
|
50
|
+
break if directory == '/'
|
51
|
+
end
|
52
|
+
|
53
|
+
@cfg_file_path ||= "#{ENV['HOME']}/.config/#{APP_NAME}"
|
41
54
|
end
|
42
55
|
|
43
56
|
@defaults = VM.new
|
data/lib/sistero/version.rb
CHANGED