mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
This allows to escape the tag length limit of 128 and better organise images from different architectures
29 lines
684 B
Bash
29 lines
684 B
Bash
PATH_TOOLS=()
|
|
TAG_TOOLS=(DEBIAN RUBY BUNDLER GOLANG GIT LFS CHROME NODE YARN POSTGRESQL GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER GCLOUD KUBECTL)
|
|
|
|
function get_image_path() {
|
|
local path
|
|
path=""
|
|
for tool in "${PATH_TOOLS[@]}"; do
|
|
if [[ -n "${!tool}" ]]; then
|
|
path="${path}-${tool,,}-${!tool}"
|
|
fi
|
|
done
|
|
|
|
if [[ -n "$path" ]]; then
|
|
echo "$CI_REGISTRY_IMAGE/${path:1}"
|
|
else
|
|
echo "$CI_REGISTRY_IMAGE"
|
|
fi
|
|
}
|
|
|
|
function get_image_tag() {
|
|
local tag
|
|
tag=""
|
|
for tool in "${TAG_TOOLS[@]}"; do
|
|
if [[ -n "${!tool}" ]]; then
|
|
tag="${tag}-${tool,,}-${!tool}"
|
|
fi
|
|
done
|
|
echo "${tag:1}"
|
|
}
|