add some content to the maven site

This commit is contained in:
Vincent Behar 2011-07-03 23:08:41 +02:00
parent 161a6309a9
commit b2f4731c4f
4 changed files with 129 additions and 0 deletions

36
src/site/apt/groovy.apt Normal file
View file

@ -0,0 +1,36 @@
------
Using the RunDeck API from Groovy scripts
------
Vincent Behar
------
2011-07-03
------
Using the RunDeck API from Groovy scripts
Here are some examples of what you can do with this lib and a few lines of {{{http://groovy.codehaus.org/}Groovy}}.
We can use {{{http://groovy.codehaus.org/Grape}Grape}} to download the lib (and its dependencies) from the {{{http://search.maven.org/}main maven repository}}, so you don't have to install anything manually (except Groovy, of course).
<<Note that the lib is NOT in the main maven repository for the moment...>> but hopefully it should be pretty soon !
* Running a job (from its name, group and project)
Save the following script in a file named "<<<rundeck.groovy>>>", and execute it with "<<<groovy rundeck.groovy>>>". Feeling Groovy ? ;-)
+--
@Grab(group='org.rundeck', module='rundeck-api-java-client', version='1.0-SNAPSHOT')
import org.rundeck.api.RundeckClient
rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
println "Running job : ${job}"
execution = rundeck.triggerJob(job.id)
println "Follow the execution at : ${execution.url}"
+--
* And more...
See the API documentation of the {{{./apidocs/org/rundeck/api/RundeckClient.html}RundeckClient}} class for more interactions with your RunDeck instance...

28
src/site/apt/index.apt Normal file
View file

@ -0,0 +1,28 @@
------
RunDeck API - Java Client
------
Vincent Behar
------
2011-07-03
------
Java client for the RunDeck REST API
* What is it ?
A Java librairie that maps the {{{http://rundeck.org}RunDeck}} HTTP REST API. RunDeck is an open-source tool for automating tasks on multiple nodes, with a CLI, a web-based interface and an HTTP REST API. You can read more about its API on the {{{http://rundeck.org/docs/RunDeck-Guide.html#rundeck-api}RunDeck User Manual}}.
This librairie has been extracted from the {{{http://wiki.jenkins-ci.org/display/JENKINS/RunDeck+Plugin}Jenkins RunDeck plugin}}, so for the moment it is still incomplete (not all the RunDeck API is mapped). My goal is to have a complete mapping of the RunDeck API, and to publish the librairie on the {{{http://search.maven.org/}main maven repository}}, so that it can easily be used by Java ({{{http://maven.apache.org}Maven}}) and Groovy ({{{http://groovy.codehaus.org/Grape}Grape}}) developers.
* What can I do with it ?
* Use it in a Java application. A good example would be the {{{http://wiki.jenkins-ci.org/display/JENKINS/RunDeck+Plugin}Jenkins RunDeck plugin}}, that needs to trigger RunDeck jobs from within the {{{http://jenkins-ci.org}Jenkins}} continuous-integration server.
* Use it to write {{{./groovy.html}Groovy}} or {{{./jruby.html}JRuby}} scripts, for example if you want to automate the execution of RunDeck jobs based on external events.
* Where can I get more information ?
* You can read the {{{./apidocs/index.html}API documentation}}
* And the code is available on {{{https://github.com/vbehar/rundeck-api-java-client}GitHub}}

47
src/site/apt/jruby.apt Normal file
View file

@ -0,0 +1,47 @@
------
Using the RunDeck API from JRuby scripts
------
Vincent Behar
------
2011-07-03
------
Using the RunDeck API from JRuby scripts
Here are some examples of what you can do with this lib and a few lines of {{{http://www.jruby.org/}Ruby}} (for the rubyist that don't fear running on the JVM !).
You will have to {{{https://github.com/vbehar/rundeck-api-java-client/downloads}download}} the lib (the .jar file) to use it...
* Running a job (from its name, group and project)
Save the following script in a file named "<<<rundeck.rb>>>", and execute it with "<<<jruby rundeck.rb>>>".
+--
require 'java'
require '/path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar'
java_import org.rundeck.api.RundeckClient
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
puts "Running job : #{job}"
execution = rundeck.triggerJob(job.id)
puts "Follow the execution at : #{execution.url}"
+--
You can also extract all the java-related stuff from the script file : save the following script in a file named "<<<rundeck.rb>>>", and execute it with "<<<jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb>>>".
+--
rundeck = org.rundeck.api.RundeckClient.new("http://localhost:4440", "admin", "admin")
job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
puts "Running job : #{job}"
execution = rundeck.triggerJob(job.id)
puts "Follow the execution at : #{execution.url}"
+--
* And more...
See the API documentation of the {{{./apidocs/org/rundeck/api/RundeckClient.html}RundeckClient}} class for more interactions with your RunDeck instance...

18
src/site/site.xml Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"
name="${project.name}">
<googleAnalyticsAccountId>UA-23435653-1</googleAnalyticsAccountId>
<body>
<menu name="${project.name}">
<item name="Introduction" href="index.html" />
<item name="API Documentation" href="apidocs/index.html" />
</menu>
<menu name="Scripting examples">
<item name="Groovy" href="groovy.html" />
<item name="JRuby" href="jruby.html" />
</menu>
<menu ref="reports" />
</body>
</project>