Created
March 27, 2018 22:51
-
-
Save dgpokl/73ce2e59c800aabfb09bbd1470a9b1bf to your computer and use it in GitHub Desktop.
Bitnami jenkins unattended 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 | |
if [[ `whoami` != 'root' ]] ; then | |
echo "Must run this as root" | |
exit 59 | |
fi | |
NEW_JENKINS="$1" | |
if [[ "$NEW_JENKINS" = "" ]] ; then | |
NEW_JENKINS='http://mirrors.jenkins-ci.org/war-stable/latest/jenkins.war' | |
fi | |
echo "Updating Jenkins to version at $NEW_JENKINS ..." | |
cd /opt/bitnami | |
cp apache-tomcat/webapps/jenkins.war /opt/bitnami/jenkins.war.bak | |
/opt/bitnami/ctlscript.sh stop tomcat | |
# DOWNTIME STARTS NOW | |
rm -r apache-tomcat/webapps/jenkins | |
rm -r apache-tomcat/webapps/jenkins.war | |
rm -r apache-tomcat/work/Catalina/localhost/jenkins | |
wget http://mirrors.jenkins-ci.org/war-stable/latest/jenkins.war | |
mv jenkins.war apache-tomcat/webapps/ | |
# DOWNTIME END | |
/opt/bitnami/ctlscript.sh start tomcat | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment