gitlab-build-images/scripts/lib/custom-docker.sh
Lukas Eipert a9cf88c469 Welcome to the matrix
This refactors our custom image building to utilize GitLab parallel jobs
with a matrix.

This makes it easier to parse what kind of matrix we are going to build
in our docker images. Furthermore instead of splitting the image name,
we can simply pull the versions of the tools from the environment
variables.

The ultimative reason: Dogfooding
2021-12-07 12:10:42 +01:00

12 lines
333 B
Bash

TOOLS=(RUBY GOLANG GIT LFS CHROME NODE YARN POSTGRESQL GRAPHICSMAGICK PGBOUNCER BAZELISK)
function get_image_name(){
local IMAGE_NAME
IMAGE_NAME=""
for tool in "${TOOLS[@]}"; do
if [ -n "${!tool}" ]; then
IMAGE_NAME="${IMAGE_NAME}-${tool,,}-${!tool}"
fi
done
echo "${IMAGE_NAME:1}"
}