Created
March 8, 2016 04:04
-
-
Save elleryq/08b2bf1286d89d8f11de to your computer and use it in GitHub Desktop.
jenkins-cli.jar wrapper. Download jenkins-cli.jar automatically and wrap it as command.
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 | |
JENKINS_URL="http://localhost/jenkins" | |
JENKINS_JAR="/tmp/jenkins-cli.jar" | |
SSL_CHAR=${JENKINS_URL:4:1} | |
if [ ! -e $JENKINS_JAR ]; then | |
WGET="wget $JENKINS_URL/jnlpJars/jenkins-cli.jar -O $JENKINS_JAR" | |
if [ "$SSL_CHAR" == "s"]; then | |
WGET="$WGET --no-check-certificate" | |
fi | |
fi | |
BASE_CMD="java -jar $JENKINS_JAR -s $JENKINS_URL/" | |
if [ "$SSL_CHAR" == "s" ]; then | |
BASE_CMD="$BASE_CMD -noCertificateCheck" | |
fi | |
if [ -z $1 ]; then | |
$BASE_CMD help | |
else | |
$BASE_CMD $* | |
fi |
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 | |
# To get installed plugins | |
jenkins-cli.sh list-plugins 2>/dev/null | awk '{if (!/^Skipping/) print $1;}' | |
# 2>/dev/null to ignore warnings | |
# "if (!/^Skipping/)" to ignore "Skipping", it is not plugin name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment