This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Author: kuisathaverat | |
Description: List ID and Description of all credentials on a Jenkins Instance. | |
**/ | |
import com.cloudbees.plugins.credentials.Credentials | |
Set<Credentials> allCredentials = new HashSet<Credentials>(); | |
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Drop this into init.groovy.d so that it gets executed at startup time. | |
// One could also use this script to explicitly set a port. | |
def inst = Jenkins.getInstance() | |
def sshDesc = inst.getDescriptor("org.jenkinsci.main.modules.sshd.SSHD") | |
sshDesc.setPort(-1) | |
sshDesc.getActualPort() | |
sshDesc.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o nounset -o errexit -o pipefail | |
usage() { | |
cat <<EOM | |
Usage: | |
$(basename $0) [OPTIONS] | |
$(basename $0) [ -j | --jenkins-url | -n | --node-name | -s | -d | --desc | --slave-home | -e | --executors | -sh | --ssh-host | -sp | --ssh-port | |
| -c | --cred-id | -l | --labels | -u | --user-id | -p | --password | -h | --help ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nectar.plugins.rbac.groups.* | |
import com.cloudbees.hudson.plugins.folder.* | |
import com.cloudbees.jenkins.plugins.foldersplus.* | |
import com.cloudbees.hudson.plugins.folder.properties.FolderProxyGroupContainer | |
//Parent folder name to start with | |
String folderName = 'EmptyFolder' | |
folderItem = Jenkins.instance.getAllItems(Folder.class).find{it.name.equals(folderName)} | |
AbstractFolder < ? > folderAbs1 = AbstractFolder.class.cast(folderItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS=$'\n\t' | |
set -euox pipefail | |
CNAME="$1" | |
FILE_PATH="$2" | |
TMPFILE="$(mktemp)" | |
docker exec "$CNAME" cat "$FILE_PATH" > "$TMPFILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo >&2 "Usage: jstackSeries <pid> [ <count> [ <delay> ] ]" | |
echo >&2 " Defaults: count = 10, delay = 1 (seconds)" | |
exit 1 | |
fi | |
pid=$1 # required | |
count=${2:-10} # defaults to 10 times |