mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 18:12:55 +01:00
Go released a new version this week; https://blog.golang.org/go1.11 which makes go 1.9 EOL. To remove that version from our testing matrix, we should make sure we support 1.11 first. This only creates the 1.11 build images, other projects need to do the cascading changes.
213 lines
6.7 KiB
Bash
Executable file
213 lines
6.7 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
IFS=$'\n\t'
|
|
|
|
function print_golang_args() {
|
|
|
|
case "$1" in
|
|
1.8|1.8.6)
|
|
INSTALL_GOLANG_VERSION=1.8.6
|
|
GOLANG_DOWNLOAD_SHA256=f558c91c2f6aac7222e0bd83e6dd595b8fac85aaa96e55d15229542eb4aaa1ff
|
|
;;
|
|
1.9)
|
|
INSTALL_GOLANG_VERSION=1.9.4
|
|
GOLANG_DOWNLOAD_SHA256=15b0937615809f87321a457bb1265f946f9f6e736c563d6c5e0bd2c22e44f779
|
|
;;
|
|
1.10|1.10.0)
|
|
INSTALL_GOLANG_VERSION=1.10
|
|
GOLANG_DOWNLOAD_SHA256=b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33
|
|
;;
|
|
1.11)
|
|
INSTALL_GOLANG_VERSION=1.11
|
|
GOLANG_DOWNLOAD_SHA256=b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499
|
|
;;
|
|
*) echo "Unknown golang version $1"; exit 1;
|
|
esac
|
|
|
|
printf -- "--build-arg INSTALL_GOLANG_VERSION=%s " "$INSTALL_GOLANG_VERSION"
|
|
printf -- "--build-arg GOLANG_DOWNLOAD_SHA256=%s " "$GOLANG_DOWNLOAD_SHA256"
|
|
}
|
|
|
|
# If you add a new minor version here, be sure to check that the
|
|
# ChromeDriver supports this: https://sites.google.com/a/chromium.org/chromedriver/downloads
|
|
# You may need to bump the version in scripts/install-chrome.
|
|
function print_chrome_args() {
|
|
case "$1" in
|
|
60|60.0)
|
|
CHROME_VERSION=60.0.3112.90-1
|
|
CHROME_DRIVER_VERSION=2.33
|
|
;;
|
|
61|61.0)
|
|
CHROME_VERSION=61.0.3163.100-1
|
|
CHROME_DRIVER_VERSION=2.34
|
|
;;
|
|
62|62.0)
|
|
CHROME_VERSION=62.0.3202.89-1
|
|
CHROME_DRIVER_VERSION=2.35
|
|
;;
|
|
63|63.0)
|
|
CHROME_VERSION=63.0.3239.132-1
|
|
CHROME_DRIVER_VERSION=2.36
|
|
;;
|
|
64|64.0)
|
|
CHROME_VERSION=64.0.3282.186-1
|
|
CHROME_DRIVER_VERSION=2.36
|
|
;;
|
|
65|65.0)
|
|
CHROME_VERSION=65.0.3325.181-1
|
|
CHROME_DRIVER_VERSION=2.36
|
|
;;
|
|
66|66.0)
|
|
CHROME_VERSION=66.0.3359.181-1
|
|
CHROME_DRIVER_VERSION=2.40
|
|
;;
|
|
67|67.0)
|
|
CHROME_VERSION=67.0.3396.79-1
|
|
CHROME_DRIVER_VERSION=2.40
|
|
;;
|
|
*) echo "Unknown chrome version $1"; exit 1;
|
|
esac
|
|
printf -- "--build-arg CHROME_VERSION=%s " "$CHROME_VERSION"
|
|
printf -- "--build-arg CHROME_DRIVER_VERSION=%s " "$CHROME_DRIVER_VERSION"
|
|
}
|
|
|
|
function print_git_args() {
|
|
case "$1" in
|
|
2.7)
|
|
# Code-debt: When the build refers to "git 2.7" its actually "default" git.
|
|
# so don't actually install a git 2.7 as a default copy is already installed
|
|
return
|
|
;;
|
|
2.8|2.8.4)
|
|
GIT_VERSION=2.8.4
|
|
GIT_DOWNLOAD_SHA256=626e319f8a24fc0866167ea5f6bf3e2f38f69d6cb2e59e150f13709ca3ebf301
|
|
;;
|
|
2.9|2.9.0)
|
|
GIT_VERSION=2.9.0
|
|
GIT_DOWNLOAD_SHA256=bff7560f5602fcd8e37669e0f65ef08c6edc996e4f324e4ed6bb8a84765e30bd
|
|
;;
|
|
2.13)
|
|
GIT_VERSION=2.13.6
|
|
GIT_DOWNLOAD_SHA256=cb53e6b388d8d19189933366c1fe5c1ca500e8b227b9e707af39c3d879e41015
|
|
;;
|
|
2.14)
|
|
GIT_VERSION=2.14.4
|
|
GIT_DOWNLOAD_SHA256=0556330e267dc968749619cd90ff6a815eda26f0c89faa5cfba56756e852202f
|
|
;;
|
|
2.16)
|
|
GIT_VERSION=2.16.4
|
|
GIT_DOWNLOAD_SHA256=e8709ebcda3d793cd933ca55004814959bb8e6fa518b5b37f602d9881e489d2e
|
|
;;
|
|
2.17)
|
|
GIT_VERSION=2.17.1
|
|
GIT_DOWNLOAD_SHA256=ec6452f0c8d5c1f3bcceabd7070b8a8a5eea11d4e2a04955c139b5065fd7d09a
|
|
;;
|
|
2.18)
|
|
GIT_VERSION=2.18.0
|
|
GIT_DOWNLOAD_SHA256=94faf2c0b02a7920b0b46f4961d8e9cad08e81418614102898a55f980fa3e7e4
|
|
;;
|
|
*) echo "Unknown git version $1"; exit 1;
|
|
esac
|
|
|
|
printf -- "--build-arg GIT_VERSION=%s " "$GIT_VERSION"
|
|
printf -- "--build-arg GIT_DOWNLOAD_SHA256=%s " "$GIT_DOWNLOAD_SHA256"
|
|
}
|
|
|
|
function print_node_args() {
|
|
case "$1" in
|
|
7.x|7.1) NODE_INSTALL_VERSION=7.x ;;
|
|
8.x) NODE_INSTALL_VERSION=8.x ;;
|
|
*) echo "Unknown node version $1"; exit 1;
|
|
esac
|
|
printf -- "--build-arg NODE_INSTALL_VERSION=%s " "$NODE_INSTALL_VERSION"
|
|
}
|
|
|
|
function print_yarn_args() {
|
|
case "$1" in
|
|
1.0) YARN_INSTALL_VERSION=1.0.2-1 ;;
|
|
1.2) YARN_INSTALL_VERSION=1.2.1-1 ;;
|
|
*) echo "Unknown yarn version $1"; exit 1;
|
|
esac
|
|
printf -- "--build-arg YARN_INSTALL_VERSION=%s " "$YARN_INSTALL_VERSION"
|
|
}
|
|
|
|
function print_postgres_args() {
|
|
printf -- "--build-arg POSTGRES_VERSION=%s " "$1"
|
|
}
|
|
|
|
function print_ansible_args() {
|
|
printf -- "--build-arg ANSIBLE_VERSION=%s " "$1"
|
|
}
|
|
|
|
function print_terraform_args() {
|
|
case "$1" in
|
|
0.11)
|
|
TERRAFORM_VERSION=0.11.7
|
|
TERRAFORM_DOWNLOAD_SHA256=6b8ce67647a59b2a3f70199c304abca0ddec0e49fd060944c26f666298e23418
|
|
;;
|
|
*) echo "Unknown terraform version $1"; exit 1;
|
|
esac
|
|
|
|
printf -- "--build-arg TERRAFORM_VERSION=%s " "$TERRAFORM_VERSION"
|
|
printf -- "--build-arg TERRAFORM_DOWNLOAD_SHA256=%s " "$TERRAFORM_DOWNLOAD_SHA256"
|
|
}
|
|
|
|
function print_graphicsmagick_args() {
|
|
case "$1" in
|
|
1.3.29)
|
|
GRAPHISMAGICK_VERSION=1.3.29
|
|
GRAPHISMAGICK_DOWNLOAD_SHA256=de820cd10597205941a7e9d02c2e679231e92e8e769c204ef09034d2279ad453
|
|
;;
|
|
*) echo "Unknown graphicsmagick version $1"; exit 1;
|
|
esac
|
|
|
|
printf -- "--build-arg GRAPHISMAGICK_VERSION=%s " "$GRAPHISMAGICK_VERSION"
|
|
printf -- "--build-arg GRAPHISMAGICK_DOWNLOAD_SHA256=%s " "$GRAPHISMAGICK_DOWNLOAD_SHA256"
|
|
}
|
|
|
|
function parse_arguments() {
|
|
read base
|
|
read base_version
|
|
|
|
# Lock Ruby to Debian stretch
|
|
case "$base" in
|
|
ruby) base_version="$base_version-stretch" ;;
|
|
esac
|
|
|
|
printf -- "-f Dockerfile.custom " "$base"
|
|
printf -- "--build-arg CUSTOM_IMAGE_NAME=%s " "$base"
|
|
printf -- "--build-arg CUSTOM_IMAGE_VERSION=%s " "$base_version"
|
|
while read image; do
|
|
read version
|
|
case "$image" in
|
|
golang) print_golang_args $version ;;
|
|
chrome) print_chrome_args $version ;;
|
|
git) print_git_args $version ;;
|
|
node) print_node_args $version ;;
|
|
yarn) print_yarn_args $version ;;
|
|
postgresql) print_postgres_args $version ;;
|
|
ansible) print_ansible_args $version ;;
|
|
terraform) print_terraform_args $version ;;
|
|
graphicsmagick) print_graphicsmagick_args $version ;;
|
|
*) exit 1;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
function generate_command() {
|
|
buildimage_name=$1; shift;
|
|
|
|
printf -- "docker build "
|
|
echo $buildimage_name | tr '-' '\n' | parse_arguments
|
|
|
|
for i in "$@"
|
|
do
|
|
printf -- "%s " "$i"
|
|
done
|
|
printf -- ".\\n"
|
|
}
|
|
|
|
docker_command=$(generate_command $@)
|
|
echo "$1: executing $docker_command"
|
|
eval $docker_command
|