Skip to content
Snippets Groups Projects

Draft: Resolve "Default docker image name too long"

Open Jon Azpiazu requested to merge 46-default-docker-image-name-too-long into master
2 unresolved threads
1 file
+ 8
0
Compare changes
  • Side-by-side
  • Inline
+ 8
0
@@ -43,6 +43,14 @@
# Get ID of image created by ddeploy
- 'DOCKER_ID=$(docker images --format="{{.ID}}" | head -1)'
- curl -Ls https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/scripts/enforce_labels.bash | bash -s -- ${DOCKER_ID}
# if USER_DOCKER_PUSH_NAME is not defined, shorten the default DOCKER_PUSH_NAME
    • Why create a third variable? The DOCKER_PUSH_NAME is already a variable that you could change with the CI and that uses CI_PROJECT_PATH.

      I would suggest changing the DOCKER_PUSH_NAME default to empty, and check it here.

Please register or sign in to reply
- >
if [ -z ${USER_DOCKER_PUSH_NAME} ] ; then
echo USER_DOCKER_PUSH_NAME was not defined, using default docker image name
DOCKER_PUSH_NAME=${DOCKER_PUSH_NAME#$CI_PROJECT_ROOT_NAMESPACE/}
else
DOCKER_PUSH_NAME=${USER_DOCKER_PUSH_NAME}
fi
# Tag and push with the branch or tag name.
- echo "Pushing to ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG}"
- docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG}
Loading