1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| VERSION=$1
echo "Upgrading jenkins to $VERSION"
echo "Downloading the jar file"
wget http://updates.jenkins-ci.org/download/war/$VERSION/jenkins.war
echo "Stopping jenkins"
service jenkins stop
sleep 5
echo "Moving the existing jenkins jar file"
TIMESTAMP=`date '+%s'`
mv /usr/share/jenkins/jenkins.war /usr/share/jenkins/jenkins.$TIMESTAMP.war
echo "Copying the latest file"
mv jenkins.war /usr/share/jenkins/jenkins.war
echo "Starting Jenkins"
service jenkins start
echo "Upgrade Successful"
|