rundock 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rundock/builder/hook_builder.rb +11 -5
- data/lib/rundock/cli.rb +2 -3
- data/lib/rundock/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: 1d532a47dd13d4984578e9656a3151f0ad93b8be
|
4
|
+
data.tar.gz: 9d95035091ac1e71c25d1d81816704559e7bb0f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d4e506533db7b293a508babe5a6fd19c81401e73f9aa0212edfaa9ad9beaa6cbf05b92295ccdbc7dfe1c9a4e0260bd38efc2b30436faaf314115a7527624c0
|
7
|
+
data.tar.gz: 4fc6a25576ee186de97e24b9a0e5a60fb2095a404b5265c691aead34c466806f892d4c6670f8fbab75d2a29e4de92ef0d6895c4cf9849af8621070301b48b476
|
@@ -3,17 +3,23 @@ require 'yaml'
|
|
3
3
|
module Rundock
|
4
4
|
module Builder
|
5
5
|
class HookBuilder < Base
|
6
|
+
DEFAULT_HOOKS_FILE_PATH = './hooks.yml'
|
6
7
|
HookStructureError = Class.new(NotImplementedError)
|
7
8
|
|
8
9
|
def build(enables)
|
9
10
|
if enables.blank?
|
10
11
|
Logger.error('Empty hook is specified.')
|
11
12
|
return []
|
12
|
-
elsif @options[:hooks]
|
13
|
-
|
14
|
-
|
13
|
+
elsif @options[:hooks]
|
14
|
+
if FileTest.exist?(@options[:hooks])
|
15
|
+
hooks_file = @options[:hooks]
|
16
|
+
Logger.info("hooks file is #{hooks_file}")
|
17
|
+
else
|
18
|
+
Logger.warn("hooks file is not found. use #{DEFAULT_HOOKS_FILE_PATH}")
|
19
|
+
hooks_file = DEFAULT_HOOKS_FILE_PATH
|
20
|
+
end
|
15
21
|
else
|
16
|
-
Logger.
|
22
|
+
Logger.info('Empty hook is specified.')
|
17
23
|
return []
|
18
24
|
end
|
19
25
|
|
@@ -42,7 +48,7 @@ module Rundock
|
|
42
48
|
end
|
43
49
|
end
|
44
50
|
|
45
|
-
Logger.
|
51
|
+
Logger.warn('Empty hook is detected. Please verity hooks file and scenario file.') if hooks.empty?
|
46
52
|
hooks
|
47
53
|
end
|
48
54
|
end
|
data/lib/rundock/cli.rb
CHANGED
@@ -6,7 +6,6 @@ module Rundock
|
|
6
6
|
DEFAULT_SCENARIO_FILE_PATH = './scenario.yml'
|
7
7
|
DEFAULT_SSH_OPTIONS_DEFAULT_FILE_PATH = './default_ssh.yml'
|
8
8
|
DEFAULT_HOSTGROUP_FILE_PATH = './hostgroup.yml'
|
9
|
-
DEFAULT_HOOKS_FILE_PATH = './hooks.yml'
|
10
9
|
|
11
10
|
class_option :log_level, type: :string, aliases: ['-l'], default: 'info'
|
12
11
|
class_option :color, type: :boolean, default: true
|
@@ -28,7 +27,7 @@ module Rundock
|
|
28
27
|
desc 'do [SCENARIO] [options]', 'Run rundock from scenario file'
|
29
28
|
option :sudo, type: :boolean, default: false
|
30
29
|
option :default_ssh_opts, type: :string, aliases: ['-d'], default: DEFAULT_SSH_OPTIONS_DEFAULT_FILE_PATH
|
31
|
-
option :hooks, type: :string, aliases: ['-k']
|
30
|
+
option :hooks, type: :string, aliases: ['-k']
|
32
31
|
option :run_anyway, type: :boolean, default: false
|
33
32
|
option :dry_run, type: :boolean, aliases: ['-n']
|
34
33
|
def do(*scenario_file_path)
|
@@ -41,7 +40,7 @@ module Rundock
|
|
41
40
|
desc 'ssh [options]', 'Run rundock ssh with various options'
|
42
41
|
option :command, type: :string, aliases: ['-c']
|
43
42
|
option :default_ssh_opts, type: :string, aliases: ['-d'], default: DEFAULT_SSH_OPTIONS_DEFAULT_FILE_PATH
|
44
|
-
option :hooks, type: :string, aliases: ['-k']
|
43
|
+
option :hooks, type: :string, aliases: ['-k']
|
45
44
|
option :host, type: :string, aliases: ['-h'], banner: 'You can specify comma separated hosts.[ex: host1,host2,..]'
|
46
45
|
option :hostgroup, type: :string, aliases: ['-g']
|
47
46
|
option :user, type: :string, aliases: ['-u']
|
data/lib/rundock/version.rb
CHANGED