Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Nicolas De loof | 1a727f9 | 2016-04-21 17:25:19 +0200 | [diff] [blame] | 3 | set -e |
| 4 | set -x |
| 5 | |
Carlos Sanchez | dd5373a | 2016-06-22 17:51:03 +0200 | [diff] [blame] | 6 | JENKINS_VERSION=`curl -sq https://api.github.com/repos/jenkinsci/jenkins/tags | grep '"name":' | grep -o '[0-9]\.[0-9]*' | uniq | sort --version-sort | tail -1` |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 7 | echo $JENKINS_VERSION |
| 8 | |
| 9 | JENKINS_SHA=`curl http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha1` |
| 10 | echo $JENKINS_SHA |
| 11 | |
Nicolas De Loof | c22225f | 2016-05-28 17:34:29 +0200 | [diff] [blame] | 12 | docker build --build-arg JENKINS_VERSION=$JENKINS_VERSION \ |
| 13 | --build-arg JENKINS_SHA=$JENKINS_SHA \ |
Carlos Sanchez | 0540f31 | 2016-06-14 15:42:47 +0200 | [diff] [blame] | 14 | --no-cache --pull \ |
Nicolas De Loof | c22225f | 2016-05-28 17:34:29 +0200 | [diff] [blame] | 15 | --tag jenkinsci/jenkins:$JENKINS_VERSION . |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 16 | |
Nicolas De Loof | 3a3295f | 2016-05-28 17:51:49 +0200 | [diff] [blame] | 17 | docker tag -f jenkinsci/jenkins:$JENKINS_VERSION jenkinsci/jenkins:latest |
Nicolas De Loof | c22225f | 2016-05-28 17:34:29 +0200 | [diff] [blame] | 18 | |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 19 | docker push jenkinsci/jenkins:$JENKINS_VERSION |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 20 | docker push jenkinsci/jenkins:latest |
| 21 | |
| 22 | |