Created
November 13, 2012 03:33
-
-
Save philosuke/4063780 to your computer and use it in GitHub Desktop.
role back jenkins
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/sh | |
# roleback version | |
VERSION=$1 | |
# directory that contains the jenkins.war | |
JENKINS_WAR_DIR=/usr/share/jenkins | |
# Absolute path the jenkins.war | |
JENKINS_WAR=${JENKINS_WAR_DIR}/jenkins.war | |
# Absolute path the jenkins.war for backup | |
JENKINS_BACKUP_WAR=/tmp/jenkins.war.bak | |
# URL of jenkins.war | |
JENKINS_WAR_URL=http://updates.jenkins-ci.org/download/war/${Version}/jenkins.war | |
# Absolute path the downloaded jenkins.war | |
DOWNLOADED_WAR=${WORKSPACE}/jenkins.war | |
# backup | |
rm -f ${JENKINS_BACKUP_WAR} | |
cp ${JENKINS_WAR} ${JENKINS_BACKUP_WAR} | |
# get jenkins.war | |
rm -f ${DOWNLOADED_WAR} | |
wget ${JENKINS_WAR_URL} --no-check-certificate | |
# replace to the new war | |
rm -f ${JENKINS_WAR} | |
cp ${DOWNLOADED_WAR} ${JENKINS_WAR} | |
# restart | |
service jenkins restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment