Skip to content

Instantly share code, notes, and snippets.

resty example, copy project config to a new project:

resty http://localhost:4440/api/11 -H 'x-rundeck-auth-token: ...'

json:

GET /project/NAME.json | jq '{ "name": ("NEWNAME"), config:.config }' | POST /projects -H 'content-type:application/json'

xml:

dignan:rundeck greg$ curl -O -J -H 'x-rundeck-auth-token:Do4d3NUD5DKk21DR4sNK755RcPk618vn' http://localhost:4440/api/11/project/ABC/export
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 237k 0 237k 0 0 71132 0 --:--:-- 0:00:03 --:--:-- 71138
curl: Saved to filename 'ABC-20140225-181150.rdproject.jar'
dignan:rundeck greg$
@gschueler
gschueler / mytest.groovy
Last active August 29, 2015 13:57
Exploring some Grails test mocks idioms
@TestFor(MyController)
public class MyTest{
@Test
public oldstyle(){
// use intermediate mock object which clutters the test
def svcMock=mockFor(MyService)
svcMock.demand.someMethod(1..1){input->null}
svcMock.demand.anotherMethod{auth,type,actions->
assert "project"== type

Java plugins

Descriptions define the plugin type and name, and optional configuration properties

All Java plugin types use Descriptions.

Some Java plugin types have configuration properties.

Some plugin types can use @PluginProperty annotations to define properties, others must define them using a Description object.

@gschueler
gschueler / rundeck-2.0.2-h2-upgrade.sh
Last active January 2, 2019 13:58
Upgrade rundeck 2.0.2 h2 database from earlier 2.0.x version.
#!/bin/bash
set -e
#set -x
RDECK_BASE=${RDECK_BASE:-$(pwd)}
CONFFILE=$1
H2JAR=$2
if [ -z "$CONFFILE" ] ; then
if [ -f ${RDECK_BASE}/server/config/rundeck-config.properties ] ; then
CONFFILE=${RDECK_BASE}/server/config/rundeck-config.properties
@gschueler
gschueler / admin.aclpolicy.yaml
Last active August 29, 2015 13:57
ACL policy for storage resources
description: Admin, all access.
context:
project: '.*' # all projects
for:
resource:
- allow: '*' # allow read/create all kinds
adhoc:
- allow: '*' # allow read/running/killing adhoc jobs
job:
- allow: '*' # allow read/write/delete/run/kill of all jobs
@gschueler
gschueler / howto.gradle
Created March 29, 2014 23:57
Aggregating javadocs for a gradle multiproject build
//ref: <http://issues.gradle.org/browse/GRADLE-1876>
apply plugin 'java'
def exportedProjects= [
":top-lib",
":sub:sub-api",
":sub:sub-lib1",
":sub:sub-lib2",
":sub:sub-lib3"
]
@gschueler
gschueler / success-template.html
Created May 2, 2014 20:21
Example email templates for rundeck notifications
<div>Execution ${execution.id} was <b>${execution.status}</b></div>
<ul>
<li><a href="${execution.href}">Execution result</a></li>
<li><a href="${job.href}">Job</a></li>
<li><a href="${execution.projectHref}">Project: ${execution.project}</a></li>
<li><a href="${rundeck.href}">Rundeck</a></li>
</ul>
<p>
</p>
@gschueler
gschueler / .bash_profile
Created June 4, 2014 18:51
🍺 or 💩
function prompt_func() {
previous_return_value=$?;
prompt="\h:\W \u"
if test $previous_return_value -eq 0
then
PS1="${prompt}🍺 "
else
PS1="${prompt}💩 "
fi
}
@gschueler
gschueler / template.sh
Last active July 13, 2017 16:30
bash template
#!/bin/bash
#/ does something ...
#/ usage: [..]
set -euo pipefail
IFS=$'\n\t'
readonly ARGS=("$@")
# <http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/>
# <http://redsymbol.net/articles/unofficial-bash-strict-mode/>