Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit a7480f97 authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

fix: branchname with '/' do to much level of namespaces on container build

parent cc49d412
No related branches found
No related tags found
No related merge requests found
Pipeline #1993 failed
......@@ -43,7 +43,8 @@ container:security:
# update vulnerabilities db
- time trivy --download-db-only --no-progress
- |- # Namespace
container_namespace="${CI_PROJECT_PATH}/branch-${CI_COMMIT_REF_NAME}"
TMP_IMAGE_BASENAME="branch-${CI_COMMIT_REF_NAME//\//_}"
container_namespace="${CI_PROJECT_PATH}/${TMP_IMAGE_BASENAME}"
- |- # Image name
if [[ -n "${IMAGE_NAME}" ]]; then
container_image_name="/${IMAGE_NAME}"
......@@ -51,7 +52,7 @@ container:security:
container_image_name=""
fi
- |- # Tags
container_tag="tmp-branch-${CI_COMMIT_REF_NAME}-$(echo ${CI_COMMIT_SHA} | cut -c1-8)"
container_tag="tmp-${TMP_IMAGE_BASENAME}-$(echo ${CI_COMMIT_SHA} | cut -c1-8)"
- |- # Full image name
full_image_name=${container_namespace}${container_image_name}
echo "⚙️ Test image: "
......
......@@ -151,10 +151,11 @@ variables:
KANIKOCFG="{ ${KANIKOCFG} }"
echo "${KANIKOCFG}" > /kaniko/.docker/config.json
- |- # Namespace
TMP_IMAGE_BASENAME="branch-${CI_COMMIT_REF_NAME//\//_}"
if [[ "${CI_JOB_STAGE}" == "delivery" ]]; then
container_namespace="${CI_PROJECT_PATH}"
else
container_namespace="${CI_PROJECT_PATH}/branch-${CI_COMMIT_REF_NAME}"
container_namespace="${CI_PROJECT_PATH}/${TMP_IMAGE_BASENAME}"
fi
- |- # Name
if [[ -n "${IMAGE_NAME}" ]]; then
......@@ -163,7 +164,7 @@ variables:
container_image_name=""
fi
- |- # Tags
container_default_tag="tmp-branch-${CI_COMMIT_REF_NAME}-$(echo ${CI_COMMIT_SHA} | cut -c1-8)"
container_default_tag="tmp-${TMP_IMAGE_BASENAME}-$(echo ${CI_COMMIT_SHA} | cut -c1-8)"
if [[ "${CI_JOB_STAGE}" != "delivery" ]]; then
container_tags="${container_default_tag}"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment