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 | |
Nicolas De loof | aed5a50 | 2016-04-21 17:27:38 +0200 | [diff] [blame] | 6 | JENKINS_VERSION=`curl -q https://api.github.com/repos/jenkinsci/jenkins/tags | grep '"name":' | grep -o '[0-9]\.[0-9]*' | uniq | 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 | |
| 12 | sed -e "s/ENV JENKINS_VERSION .*/ENV JENKINS_VERSION $JENKINS_VERSION/g" -e "s/ENV JENKINS_SHA .*/ENV JENKINS_SHA $JENKINS_SHA/g" Dockerfile > Dockerfile.$JENKINS_VERSION |
| 13 | |
| 14 | docker build -f Dockerfile.$JENKINS_VERSION -t jenkinsci/jenkins:$JENKINS_VERSION . |
| 15 | docker push jenkinsci/jenkins:$JENKINS_VERSION |
| 16 | |
| 17 | docker build -f Dockerfile.$JENKINS_VERSION -t jenkinsci/jenkins:latest . |
| 18 | docker push jenkinsci/jenkins:latest |
| 19 | |
| 20 | |