blob: 3e12e068ed48d62ab27bbd7b314ebaad411444ed [file] [log] [blame]
Nicolas De Loof58826312014-11-28 10:52:05 +01001#!/bin/bash
2set -e
3
4versions=( "$@" )
5if [ ${#versions[@]} -eq 0 ]; then
6 versions=( */ )
7fi
8versions=( "${versions[@]%/}" )
9
10for version in "${versions[@]}"; do
11 rm -rf "$version"/*
12 cp Dockerfile.template jenkins.sh plugins.sh init.groovy "$version/"
13 mv "$version/Dockerfile.template" "$version/Dockerfile"
Nicolas De Loof40c3e3f2014-12-02 17:19:06 +010014 case $version in
15 1\.*\.*) download="http:\/\/mirrors.jenkins-ci.org\/war-stable\/$version\/jenkins.war" ;;
16 *) download="http:\/\/mirrors.jenkins-ci.org\/war\/$version\/jenkins.war" ;;
17 esac
18
19 sed -i "" 's/%%JENKINS_VERSION%%/'$version'/g; s/%%DOWNLOAD_URL%%/'$download'/g' "$version/Dockerfile"
Nicolas De Loof58826312014-11-28 10:52:05 +010020done
21