Wagon: Deploying site to repository

This commit is contained in:
Vincent Behar 2011-07-05 19:03:43 +02:00
parent 83dd6ad2b6
commit da67b6e549
138 changed files with 6277 additions and 1018 deletions

View file

@ -1,18 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Jul 3, 2011 -->
<!-- Generated by Apache Maven Doxia at Jul 5, 2011 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Using the RunDeck API from JRuby scripts</title>
<title></title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="author" content="Vincent Behar" />
<meta name="Date-Creation-yyyymmdd" content="20110703" />
<meta name="Date-Revision-yyyymmdd" content="20110703" />
<meta name="Date-Revision-yyyymmdd" content="20110705" />
<meta http-equiv="Content-Language" content="en" />
<!-- Google Analytics -->
@ -41,14 +39,19 @@
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2011-07-03</span>
&nbsp;| <span id="projectVersion">Version: 1.0-SNAPSHOT</span>
</div>
<div class="xright">
<a href="http://rundeck.org" class="externalLink" title="RunDeck">RunDeck</a>
&gt;
<a href="./" title="RunDeck API - Java Client">RunDeck API - Java Client</a>
&gt;
</div>
<div class="xright">
<span id="publishDate">Last Published: 2011-07-05</span>
&nbsp;| <span id="projectVersion">Version: 1.0-SNAPSHOT</span>
</div>
<div class="clear">
<hr/>
</div>
@ -56,11 +59,14 @@
<div id="leftColumn">
<div id="navcolumn">
<h5>RunDeck API - Java Client</h5>
<ul>
<li class="none">
<a href="index.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="download.html" title="Download">Download</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="API Documentation">API Documentation</a>
@ -68,12 +74,18 @@
</ul>
<h5>Scripting examples</h5>
<ul>
<li class="none">
<a href="scripting.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="groovy.html" title="Groovy">Groovy</a>
</li>
<li class="none">
<strong>JRuby</strong>
</li>
<li class="none">
<a href="jython.html" title="Jython">Jython</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
@ -88,28 +100,59 @@
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>Using the RunDeck API from JRuby scripts<a name="Using_the_RunDeck_API_from_JRuby_scripts"></a></h2><p>Here are some examples of what you can do with this lib and a few lines of <a class="externalLink" href="http://www.jruby.org/">Ruby</a> (for the rubyist that don't fear running on the JVM !). You will have to <a class="externalLink" href="https://github.com/vbehar/rundeck-api-java-client/downloads">download</a> the lib (the .jar file) to use it...</p><div class="section"><h3>Running a job (from its name, group and project)<a name="Running_a_job_from_its_name_group_and_project"></a></h3><p>Save the following script in a file named &quot;<tt>rundeck.rb</tt>&quot;, and execute it with &quot;<tt>jruby rundeck.rb</tt>&quot;.</p><div class="source"><pre>require 'java'
<div class="section"><h2>Using the RunDeck API from JRuby scripts<a name="Using_the_RunDeck_API_from_JRuby_scripts"></a></h2></div><p>Here are some examples of what you can do with this lib and a few lines of <a class="externalLink" href="http://www.jruby.org/">Ruby</a> (for the rubyist that don't fear running on the JVM !)</p><p>You will have to <a href="./download.html">download</a> the lib (the .jar file) to use it...</p><div class="section"><h3>Basic usage<a name="Basic_usage"></a></h3></div><p>Save the following script in a file named &quot;<tt>rundeck.rb</tt>&quot;, and execute it with &quot;<tt>jruby rundeck.rb</tt>&quot;.</p><div class="source"><pre>require 'java'
require '/path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar'
java_import org.rundeck.api.RundeckClient
import org.rundeck.api.RundeckClient
rundeck = RundeckClient.new(&quot;http://localhost:4440&quot;, &quot;admin&quot;, &quot;admin&quot;)
puts &quot;All RunDeck projects : #{rundeck.projects}&quot;
puts &quot;All RunDeck jobs : #{rundeck.jobs}&quot;
</pre></div><p>You can also add the librairie to the classpath : save the following script in a file named &quot;<tt>rundeck.rb</tt>&quot;, and execute it with &quot;<tt>jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb</tt>&quot;.</p><div class="source"><pre>import org.rundeck.api.RundeckClient
rundeck = RundeckClient.new(&quot;http://localhost:4440&quot;, &quot;admin&quot;, &quot;admin&quot;)
puts &quot;All RunDeck projects : #{rundeck.projects}&quot;
puts &quot;All RunDeck jobs : #{rundeck.jobs}&quot;
</pre></div><div class="section"><h3>Running a job<a name="Running_a_job"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
import org.rundeck.api.util.OptionsBuilder
import org.rundeck.api.util.NodeFiltersBuilder
rundeck = RundeckClient.new(&quot;http://localhost:4440&quot;, &quot;admin&quot;, &quot;admin&quot;)
// find a job from its name, group and project
job = rundeck.findJob(&quot;my-project&quot;, &quot;main-group/sub-group&quot;, &quot;job-name&quot;)
puts &quot;Running job : #{job}&quot;
puts &quot;Found job with ID : #{job.id}&quot;
// trigger a simple job with no options
execution = rundeck.triggerJob(job.id)
puts &quot;Follow the execution at : #{execution.url}&quot;</pre></div><p>You can also extract all the java-related stuff from the script file : save the following script in a file named &quot;<tt>rundeck.rb</tt>&quot;, and execute it with &quot;<tt>jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb</tt>&quot;.</p><div class="source"><pre>rundeck = org.rundeck.api.RundeckClient.new(&quot;http://localhost:4440&quot;, &quot;admin&quot;, &quot;admin&quot;)
puts &quot;Execution started, you can follow it at the URL : #{execution.url}&quot;
job = rundeck.findJob(&quot;my-project&quot;, &quot;main-group/sub-group&quot;, &quot;job-name&quot;)
puts &quot;Running job : #{job}&quot;
// or with options...
execution = rundeck.triggerJob(&quot;job-id&quot;, OptionsBuilder.new().addOption(&quot;option1&quot;, &quot;value one&quot;).addOption(&quot;option2&quot;, &quot;value two&quot;).toProperties())
execution = rundeck.triggerJob(job.id)
puts &quot;Follow the execution at : #{execution.url}&quot;</pre></div></div><div class="section"><h3>And more...<a name="And_more..."></a></h3><p>See the API documentation of the <a href="./apidocs/org/rundeck/api/RundeckClient.html">RundeckClient</a> class for more interactions with your RunDeck instance...</p></div></div>
// you can also override the nodes on which the job should execute
execution = rundeck.triggerJob(&quot;job-id&quot;, OptionsBuilder.new().addOption(&quot;opt&quot;, &quot;value&quot;).toProperties(), NodeFiltersBuilder.new().tags(&quot;prod+appserv&quot;).toProperties())
// last one : you can run a job and wait until its execution is finished :
execution = rundeck.runJob(&quot;job-id&quot;)
puts &quot;Execution finished ! Status : #{execution.status}, duration (in seconds) : #{execution.durationInSeconds}&quot;
</pre></div><div class="section"><h3>Running an ad-hoc command<a name="Running_an_ad-hoc_command"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
import org.rundeck.api.util.NodeFiltersBuilder
rundeck = RundeckClient.new(&quot;http://localhost:4440&quot;, &quot;admin&quot;, &quot;admin&quot;)
// trigger the execution of the &quot;uptime&quot; command on the RunDeck server
execution = rundeck.triggerAdhocCommand(&quot;my-project&quot;, &quot;uptime&quot;)
// run the &quot;uptime&quot; command on all unix nodes
execution = rundeck.runAdhocCommand(&quot;my-project&quot;, &quot;uptime&quot;, NodeFiltersBuilder.new().osFamily(&quot;unix&quot;).toProperties())
</pre></div><div class="section"><h3>And more...<a name="And_more..."></a></h3></div><p>See the API documentation of the <a href="./apidocs/org/rundeck/api/RundeckClient.html">RundeckClient</a> class for more interactions with your RunDeck instance...</p>
</div>
</div>
<div class="clear">
@ -119,7 +162,7 @@ puts &quot;Follow the execution at : #{execution.url}&quot;</pre></div></div><di
<div class="xright">
Copyright &#169; 2011.
All Rights Reserved.
</div>
<div class="clear">
<hr/>