I got really tired of manually upgrading Jenkins on my build server so I wrote a little bash script to do it for me.
1 2 3 4 5 6 7 8 9 10 11 12 13
I call mine upgrade.sh. Make sure to set the permissions on the file to something executable; I set mine to chmod 775. Then you can run this by typing the following line. It should be run with elevated permissions so it can interact with processes like starting and stopping the server.
$ sudo ./upgrade.sh
You may have to tweak the locations to suit your needs. Another thing you may want to do is move your jenkins folder instead of removing it, but since config is stored else where you should be okay to just remove the web app and put the new war in it’s place.