Created
August 18, 2017 11:07
-
-
Save lcguida/c6ec62c2c5388ec9c0120a6288b4eb96 to your computer and use it in GitHub Desktop.
Jenkins update script
This file contains hidden or 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_PATH=/usr/share/jenkins | |
echo -n "Removing old jenkins.war backcups ... " | |
rm -rf $JENKINS_PATH/jenkins.war.*.bkp | |
echo "Done" | |
echo -n "Backing up the current jenkins.war file ... " | |
cp $JENKINS_PATH/jenkins.war $JENKINS_PATH/jenkins.war.$(date +"%Y%m%d").bkp | |
echo "Done" | |
echo -n "Downloading the new jenkins.war ..." | |
wget -q "http://updates.jenkins-ci.org/stable/latest/jenkins.war" -O $JENKINS_PATH/jenkins.war | |
echo "done" | |
echo -n "Restarting jenkins service... " | |
service jenkins restart | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment