improved_jenkins_client 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/jenkinscli +5 -0
- data/improved_jenkins_client.gemspec +34 -0
- data/java_deps/jenkins-cli.jar +0 -0
- data/lib/improved_jenkins_client/build_queue.rb +262 -0
- data/lib/improved_jenkins_client/cli/base.rb +84 -0
- data/lib/improved_jenkins_client/cli/helper.rb +61 -0
- data/lib/improved_jenkins_client/cli/job.rb +133 -0
- data/lib/improved_jenkins_client/cli/node.rb +97 -0
- data/lib/improved_jenkins_client/cli/system.rb +65 -0
- data/lib/improved_jenkins_client/client.rb +855 -0
- data/lib/improved_jenkins_client/exceptions.rb +246 -0
- data/lib/improved_jenkins_client/job.rb +1966 -0
- data/lib/improved_jenkins_client/node.rb +353 -0
- data/lib/improved_jenkins_client/plugin_manager.rb +460 -0
- data/lib/improved_jenkins_client/plugin_settings/base.rb +11 -0
- data/lib/improved_jenkins_client/plugin_settings/collection.rb +39 -0
- data/lib/improved_jenkins_client/plugin_settings/hipchat.rb +53 -0
- data/lib/improved_jenkins_client/plugin_settings/workspace_cleanup.rb +35 -0
- data/lib/improved_jenkins_client/root.rb +67 -0
- data/lib/improved_jenkins_client/system.rb +134 -0
- data/lib/improved_jenkins_client/urihelper.rb +18 -0
- data/lib/improved_jenkins_client/user.rb +131 -0
- data/lib/improved_jenkins_client/version.rb +36 -0
- data/lib/improved_jenkins_client/view.rb +313 -0
- data/lib/improved_jenkins_client.rb +52 -0
- metadata +172 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2012-2013 Kannan Manickam <arangamani.kannan@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'thor'
|
24
|
+
require 'thor/group'
|
25
|
+
|
26
|
+
module JenkinsApi
|
27
|
+
module CLI
|
28
|
+
# This class provides various command line operations to System class.
|
29
|
+
class System < Thor
|
30
|
+
include Thor::Actions
|
31
|
+
|
32
|
+
desc "quietdown", "Puts the Jenkins server in Quiet down mode"
|
33
|
+
# CLI command that puts Jenkins in Quiet Down mode
|
34
|
+
def quietdown
|
35
|
+
@client = Helper.setup(parent_options)
|
36
|
+
@client.system.quiet_down
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "cancel_quietdown", "Cancels the Quiet down mode of Jenkins server"
|
40
|
+
# CLI command that cancels Jenkins from Quiet Down mode
|
41
|
+
def cancel_quietdown
|
42
|
+
@client = Helper.setup(parent_options)
|
43
|
+
@client.system.cancel_quiet_down
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "reload", "Reload Jenkins server"
|
47
|
+
# CLI command to reload Jenkins configuration from disk
|
48
|
+
def reload
|
49
|
+
@client = Helper.setup(parent_options)
|
50
|
+
@client.system.reload
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "restart", "Restarts the Jenkins server"
|
54
|
+
method_option :force, :type => :boolean, :aliases => "-s",
|
55
|
+
:desc => "Force restart"
|
56
|
+
# CLI command to (force) restart Jenkins
|
57
|
+
def restart
|
58
|
+
@client = Helper.setup(parent_options)
|
59
|
+
force = options[:force] ? true : false
|
60
|
+
@client.system.restart(force)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|