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 / 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 / .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
}

Keybase proof

I hereby claim:

  • I am gschueler on github.
  • I am gschueler (https://keybase.io/gschueler) on keybase.
  • I have a public key whose fingerprint is E8B3 2504 E022 A56B 45D9 F262 BC44 BA95 F744 24A6

To claim this, I am signing this object:

@gschueler
gschueler / plugin.yaml
Last active August 29, 2015 14:22
put in my-step-plugin/plugin.yaml
name: My plugin
version: 1.0
rundeckPluginVersion: 1.0
author: Your name
date: 9/26/13
providers:
- name: my-plugin
service: WorkflowStep
title: My Plugin
description: Demonstrates plugins
@gschueler
gschueler / nodescript.sh
Last active August 29, 2015 14:22
put in my-plugin/contents/
#!/bin/sh
NAME=$1
shift
MOOD=$1
shift
NODE=$1
echo "Hi $NAME@$NODE, it's interesting that you feel $MOOD"
whoami