Nicolas De Loof | 5882631 | 2014-11-28 10:52:05 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | versions=( "$@" ) |
| 5 | if [ ${#versions[@]} -eq 0 ]; then |
| 6 | versions=( */ ) |
| 7 | fi |
| 8 | versions=( "${versions[@]%/}" ) |
| 9 | |
| 10 | for 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 Loof | 40c3e3f | 2014-12-02 17:19:06 +0100 | [diff] [blame] | 14 | 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 Loof | 5882631 | 2014-11-28 10:52:05 +0100 | [diff] [blame] | 20 | done |
| 21 | |