Skip to content

Instantly share code, notes, and snippets.

View kmadel's full-sized avatar

Kurt Madel kmadel

View GitHub Profile
#!/bin/bash
set -e
UPDATES_URL="http://updates.jenkins-ci.org/download/plugins/"
if [ $# -lt 2 ]; then
echo "USAGE: $0 plugin-list-file destination-directory"
exit 1
fi
/*** BEGIN META {
"name" : "Count executors",
"comment" : "Shows the total number of nodes and executors on Jenkins",
"parameters" : [ ],
"core": "1.350",
"authors" : [
{ name : "Andy Pemberton" }
]
} END META**/
import jenkins.model.Jenkins
@kmadel
kmadel / Jenkinsfile
Created November 30, 2015 19:33 — forked from chinshr/Jenkinsfile
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
import hudson.model.*
def payloadString = build.buildVariableResolver.resolve("payload")
payloadObject = new groovy.json.JsonSlurper().parseText(payloadString)
targetCommit = payloadObject.pull_request.head.sha
build.addAction(new ParametersAction(new StringParameterValue('targetCommit', targetCommit)))