Skip to content

Instantly share code, notes, and snippets.

rtyler / find-ed25519.groovy
Last active Oct 12, 2018
Determine whether there are passphrase-protected ed25519 keys in a Jenkins instance
View find-ed25519.groovy
import com.cloudbees.hudson.plugins.folder.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey
/* Let's see if the key is ed25518 */
boolean checkKey(def key) {
boolean found = false
exec docker run --rm -ti -p 8080:8080 -e GITHUB_USER=rtyler -v $PWD/init.groovy.d:/var/jenkins_home/init.groovy.d -e CLIENT_SECRET=foobar -e CLIENT_ID=foobar -e AZURE_SUBSCRIPTION_ID=fooar -e AZURE_TENANT_ID=FOOBAR -e AZURE_CLIENT_ID=FOOBAR-e AZURE_CLIENT_SECRET="FOOBAR" rtyler/codevalet-master
View agent.ps1
Set-ExecutionPolicy Unrestricted
$jenkinsServerUrl = $args[0]
$vmName = $args[1]
$secret = $args[2]
$jenkinsSlaveJarUrl = $jenkinsServerUrl + "jnlpJars/slave.jar"
$jnlpUrl=$jenkinsServerUrl + 'computer/' + $vmName + '/slave-agent.jnlp'
$baseDir = 'c:\azurecsdir'
$JDKUrl = ''
View function.json
"bindings": [
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req"
"type": "http",
rtyler / 0_console.log
Created Dec 9, 2016
Demonstrating setters/getters in a Pipeline Shared Library
View 0_console.log
Started by user rtyler
Loading library pipeline-library@acme-test
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git:// # timeout=10
Fetching upstream changes from git://
> git --version # timeout=10
> git fetch --tags --progress git:// +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/acme-test^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/acme-test^{commit} # timeout=10
rtyler / 0_error.log
Created Dec 9, 2016
Example of an invalid casing for a Global Variable in a Pipeline Shared Library
View 0_error.log
Started by user rtyler
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 2: unexpected token: Mr Jenkins @ line 2, column 14.
SayHello "Mr Jenkins"
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(
at org.codehaus.groovy.control.ErrorCollector.addFatalError(
View Jenkinsfile
#!/usr/bin/env groovy
node {
stage('Build') {
sh 'make'
stage('Test') {
sh 'make check' /* if this returns non-zero, the Pipeline stops */
junit 'reports/**/*.xml'
/* otherwise...we could: */
View Dockerfile
FROM jetty:9-alpine
# Add our system dependencies for running jetty and node services inside the
# container
RUN apk update && apk add supervisor nodejs
# Bring our Java backend app over for Jetty
COPY target/*.war /var/lib/jetty/webapps/ROOT.war
View gist:1200a9c1593df8c54f797b6cbcfebf1a
This file has been truncated, but you can view the full file.
% mvn clean verify
[INFO] ------------------------------------------------------------------------
[INFO] Building plugin-site-api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ plugin-site-api ---
[INFO] Deleting /home/tyler/source/github/jenkins-infra/plugin-site/target