Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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

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 / 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
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$

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:

package com.dtolabs.rundeck.app.internal.logging
import com.dtolabs.rundeck.core.execution.Contextual
import com.dtolabs.rundeck.core.logging.LogLevel
import com.dtolabs.rundeck.core.logging.LogUtil
import com.dtolabs.rundeck.core.logging.StreamingLogWriter
/**
Thread local buffered log output
@gschueler
gschueler / policy1.yaml
Last active May 4, 2017 17:27
example restriction for group to set of jobs
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:
- match: