blob: d70452d0630b31724454367462b9bdee741a7dba [file] [log] [blame]
Nicolas De Loof108666f2015-09-29 10:19:56 +02001#!/bin/bash
2
Nicolas De loof1a727f92016-04-21 17:25:19 +02003set -e
4set -x
5
Nicolas De loofaed5a502016-04-21 17:27:38 +02006JENKINS_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 Loof108666f2015-09-29 10:19:56 +02007echo $JENKINS_VERSION
8
9JENKINS_SHA=`curl http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha1`
10echo $JENKINS_SHA
11
Nicolas De Loofc22225f2016-05-28 17:34:29 +020012docker build --build-arg JENKINS_VERSION=$JENKINS_VERSION \
13 --build-arg JENKINS_SHA=$JENKINS_SHA \
Carlos Sanchez0540f312016-06-14 15:42:47 +020014 --no-cache --pull \
Nicolas De Loofc22225f2016-05-28 17:34:29 +020015 --tag jenkinsci/jenkins:$JENKINS_VERSION .
Nicolas De Loof108666f2015-09-29 10:19:56 +020016
Nicolas De Loof3a3295f2016-05-28 17:51:49 +020017docker tag -f jenkinsci/jenkins:$JENKINS_VERSION jenkinsci/jenkins:latest
Nicolas De Loofc22225f2016-05-28 17:34:29 +020018
Nicolas De Loof108666f2015-09-29 10:19:56 +020019docker push jenkinsci/jenkins:$JENKINS_VERSION
Nicolas De Loof108666f2015-09-29 10:19:56 +020020docker push jenkinsci/jenkins:latest
21
22