I’m creating docker image in my CI/CD. I’m currently using $CI_COMMIT_REF_SLUG but I’d like to use CI_COMMIT_TAG is it exists and only revert to $CI_COMMIT_REF_SLUG if it does not.
What’s a simple way to accomplish this? I have not seen a way to conditionally set a variable on the variable section.
Can you suggest a proper way to do this?
I’, currently doong:
build_image: image: docker tags: - django variables: ENV: dev DOCKER_BUILDKIT: 1 IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG