jendle 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jendle/cli.rb +7 -1
- data/lib/jendle/core.rb +3 -1
- data/lib/jendle/job.rb +10 -2
- data/lib/jendle/plugin.rb +2 -9
- data/lib/jendle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8558843a07a6ac216a4fa5ef18672857005f7be0
|
4
|
+
data.tar.gz: be50360e7a9da12a7ffa8ec98721a8767c6cd2e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 326744758578b85f3d73ffb41c951706b8d3091621d2f1721be5dfabbdbd9bbca34519b3372e5365fd88621c5569cab82004c0025cdfd9ea1e85204f50eeb38f
|
7
|
+
data.tar.gz: 24f8e2f08bc22e673ec227dd65d7ca0d0bfec641ed68b9962cd269a3cc1d74222fb8091b1c446e3e782fc9f2bfb90feade009529fb039690ba798828385a4a81
|
data/lib/jendle/cli.rb
CHANGED
@@ -78,8 +78,9 @@ module Jendle
|
|
78
78
|
desc 'restore_jobs', 'restore_jobs'
|
79
79
|
option :source_profile, type: :string, required: true, desc: 'file'
|
80
80
|
option :'dry-run', aliases: '-d', type: :boolean, default: false, desc: 'dry-run'
|
81
|
+
option :job_name, aliases: '-j', type: :string, desc: 'job_name'
|
81
82
|
def restore_jobs
|
82
|
-
@job.restore(options, get_config(options[:source_profile]))
|
83
|
+
@job.restore(options, get_config(options[:source_profile]), options[:job_name])
|
83
84
|
end
|
84
85
|
|
85
86
|
desc 'export_views', 'export_views'
|
@@ -107,6 +108,11 @@ module Jendle
|
|
107
108
|
@core.restart
|
108
109
|
end
|
109
110
|
|
111
|
+
desc 'delete_jobs', 'delete_jobs'
|
112
|
+
def delete_jobs
|
113
|
+
@job.delete_jobs(options)
|
114
|
+
end
|
115
|
+
|
110
116
|
desc 'version', 'show version'
|
111
117
|
def version
|
112
118
|
puts VERSION
|
data/lib/jendle/core.rb
CHANGED
data/lib/jendle/job.rb
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
module Jendle
|
2
2
|
class Job < Base
|
3
3
|
|
4
|
-
def
|
4
|
+
def delete_jobs(options)
|
5
|
+
get_config_pairs.keys.each do |job_name|
|
6
|
+
@client.job.delete(job_name)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def restore(options, source_config, apply_job_name = nil)
|
5
11
|
source_client = @core.get_client(
|
6
12
|
source_config['server_ip'],
|
7
13
|
source_config['username'],
|
8
14
|
source_config['password']
|
9
15
|
)
|
10
16
|
get_config_pairs(source_client).each do |job_name, xml|
|
11
|
-
|
17
|
+
if (job_name == apply_job_name) || apply_job_name.nil?
|
18
|
+
apply_proc(job_name, xml, options[:'dry-run'])
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
|
data/lib/jendle/plugin.rb
CHANGED
@@ -11,7 +11,7 @@ module Jendle
|
|
11
11
|
plugins.each do |k, v|
|
12
12
|
apply_proc(k)
|
13
13
|
end
|
14
|
-
restart
|
14
|
+
@core.restart
|
15
15
|
end
|
16
16
|
|
17
17
|
def export(options)
|
@@ -29,7 +29,7 @@ module Jendle
|
|
29
29
|
plugin = plugin.strip
|
30
30
|
apply_proc(plugin)
|
31
31
|
end
|
32
|
-
restart
|
32
|
+
@core.restart
|
33
33
|
end
|
34
34
|
|
35
35
|
def apply_proc(plugin)
|
@@ -40,12 +40,5 @@ module Jendle
|
|
40
40
|
@logger.info("already installed #{plugin}")
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
44
|
-
def restart
|
45
|
-
if @client.plugin.restart_required?
|
46
|
-
@logger.info("restarting...")
|
47
|
-
@client.system.restart(true)
|
48
|
-
end
|
49
|
-
end
|
50
43
|
end
|
51
44
|
end
|
data/lib/jendle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jendle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|