mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 02:22:57 +01:00
Allow to prefix deployed images into nested
This allows to escape the tag length limit of 128 and better organise images from different architectures
This commit is contained in:
parent
779a199009
commit
ee1bb21ec9
3 changed files with 35 additions and 16 deletions
|
|
@ -1,12 +1,29 @@
|
|||
TOOLS=(DEBIAN RUBY BUNDLER GOLANG GIT LFS CHROME NODE YARN POSTGRESQL GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER GCLOUD KUBECTL)
|
||||
PATH_TOOLS=()
|
||||
TAG_TOOLS=(DEBIAN RUBY BUNDLER GOLANG GIT LFS CHROME NODE YARN POSTGRESQL GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER GCLOUD KUBECTL)
|
||||
|
||||
function get_image_name(){
|
||||
local IMAGE_NAME
|
||||
IMAGE_NAME=""
|
||||
for tool in "${TOOLS[@]}"; do
|
||||
if [ -n "${!tool}" ]; then
|
||||
IMAGE_NAME="${IMAGE_NAME}-${tool,,}-${!tool}"
|
||||
function get_image_path() {
|
||||
local path
|
||||
path=""
|
||||
for tool in "${PATH_TOOLS[@]}"; do
|
||||
if [[ -n "${!tool}" ]]; then
|
||||
path="${path}-${tool,,}-${!tool}"
|
||||
fi
|
||||
done
|
||||
echo "${IMAGE_NAME:1}"
|
||||
|
||||
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}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue