Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Note 1: The following CQ curl commands assumes a admin:admin username and password. | |
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command. | |
Example: -F"":operation=delete"" | |
Note 3: Quotes around name of package (or name of zip file, or jar) should be included. | |
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console) | |
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle" | |
Install a bundle | |
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
// serviceConfig.each { | |
// serviceName, config -> | |
// println serviceName | |
// println config | |
// def plan = config.plan | |
// def label = config.label | |
// | |
// def createServiceCmd = "cf create-service ${label} ${plan} ${serviceName}" | |
// def isServiceAvailable = "cf services | grep -w \'${serviceName}\' | wc -l" | |
// |
def jobs = Jenkins.instance.getAllItems(Job.class) | |
jobs.each{it.save()} |
def jobs = Jenkins.instance.getAllItems(Job.class) | |
def jobPattern = "" | |
// Should we be disabling or enabling jobs? "disable" or "enable", case-insensitive. | |
def disableOrEnable = "enable" | |
//Permission config = new Permission(CONFIGURE) | |
def lcFlag = disableOrEnable.toLowerCase() | |
if (lcFlag.equals("disable") || lcFlag.equals("enable")) { | |
def matchedJobs = jobs.each{ job -> | |
job.isBuildable() | |
} |
for i in 1 2 3; do | |
docker-machine create -d virtualbox node-$i | |
done | |
eval $(docker-machine env node-1) | |
docker swarm init \ | |
--advertise-addr $(docker-machine ip node-1) | |
TOKEN=$(docker swarm join-token -q worker) |
#!/bin/bash | |
# REPO_NAME=<repo>.git | |
# ORIGIN_URL=git@<host>:<project>/$REPO_NAME | |
# REPO1_URL=git@<host>:<project>/$REPO_NAME | |
rm -rf $REPO_NAME | |
git clone --bare $ORIGIN_URL | |
if [ "$?" != "0" ]; then | |
echo "ERROR: failed clone of $ORIGIN_URL" |