Skip to content

Instantly share code, notes, and snippets.

View gotchas.md

an incomplete list of gotchas while using the Groovy language

for vs each

def findItem(key){
	def defval='some value'
	someMap.each{k,v->
		if(k.startsWith(key)){
			return v
		}
View guide.md

enable debug logging for rundeck grails controller in rundeck 3

Create a file logback.groovy as above.

Launch rundeck with the following jvm system property: logging.config=<path to logback.groovy>

for example:

java -Xmx4g -Dlogging.config=`pwd`/server/config/logback.groovy -jar rundeck-3.0.20-20190408.war
@gschueler
gschueler / Overview.md
Last active Jun 7, 2017
Dev blog for data capture/data passing feature for Rundeck
View Overview.md

Goals:

Data passing: Workflow steps can export data values that are made available to subsequent steps. Data capture: Step logger system can filter/process output log events to extract useful data values and use the data passing feature to pass them along.

Tasks:

Data Passing:

  • Ability to pass data from one step to the next. This will be via a workflow global data context.
@gschueler
gschueler / grails indexes.md
Created Apr 24, 2017
Grails indexes (2.x)
View grails indexes.md

Notes on adding index definitions to Grails 2 domain classes

Add an index named MY_INDEX to two columns:

Inside your Domain class:

static mapping={
@gschueler
gschueler / Dockerfile
Created Mar 13, 2017
rundeck ubuntu 16.04
View Dockerfile
FROM ubuntu:16.04
RUN apt-get -y update && \
apt-get -y install openjdk-8-jdk apt-transport-https curl openssh-client uuid-runtime
ENV RDECK_BASE=/var/lib/rundeck
RUN mkdir $RDECK_BASE
RUN echo "deb https://rundeck.bintray.com/rundeck-deb /" | tee -a /etc/apt/sources.list
View gist:c4badb4985cc4badc455ade7f3aeff24
[~/devel/test-g255] 💩 ls
grails-2.5.5 grails-2.5.5.zip
[~/devel/test-g255] 🍺 which grails
/Users/greg/devel/test-g255/grails-2.5.5/bin/grails
[~/devel/test-g255] 🍺 grails create-app --stacktrace
| Configuring classpath
:: problems summary ::
:::: WARNINGS
module not found: org.codehaus.groovy#groovy-all;2.4.4
==== grailsPlugins: tried
View jobs.groovy
@Grapes(
@Grab(group='org.rundeck', module='rundeck-api-java-client', version='13.1')
)
import org.rundeck.api.*;
def rundeck = RundeckClient.builder().url(args[0]).login(args[1],args[2]).build()
//def rundeck = RundeckClient.builder().url(args[0]).token(args[1]).build()
def project=args[3]
def jobs = rundeck.getJobs(project)
@gschueler
gschueler / gist:7f14ab424294286eb677
Created Oct 21, 2015
Geb grails functional test error
View gist:7f14ab424294286eb677
| Failure: edit page(domain.scheduledExecution.JobEditSpec)
| java.lang.VerifyError: Bad <init> method call from inside of a branch
Exception Details:
Location:
geb/navigator/SearchContextBasedBasicLocator.<init>(Lorg/openqa/selenium/SearchContext;Lgeb/navigator/factory/NavigatorFactory;)V @91: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: b800 214e 05bd 0004 5903 04bd 0004 5903
0000010: 2b53 b800 2753 5904 2c53 5910 ff12 02b8
View date.sh
#!/bin/bash
#determine h:m:s to run, 10 seconds from now
ORIG_DATE=$(date '+%s')
echo "orig: $ORIG_DATE"
NEW_DATE=$(( $ORIG_DATE + 10 ))
echo "new: $NEW_DATE"
You can’t perform that action at this time.