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 | |
Eli Young | 52fa1d7 | 2016-10-06 12:00:47 -0700 | [diff] [blame] | 6 | JENKINS_VERSION=$(curl -sq https://api.github.com/repos/jenkinsci/jenkins/tags | grep '"name":' | egrep -o '[0-9]+(\.[0-9]+)+' | sort --version-sort | uniq | tail -1) |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [diff] [blame] | 7 | echo "$JENKINS_VERSION" |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 8 | |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [diff] [blame] | 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" |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 11 | |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [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 \ |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [diff] [blame] | 15 | --tag "jenkinsci/jenkins:$JENKINS_VERSION" . |
Nicolas De Loof | 108666f | 2015-09-29 10:19:56 +0200 | [diff] [blame] | 16 | |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [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 | |
Charles Duffy | 3eec42c | 2016-09-20 12:11:33 -0500 | [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 | |