File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,10 @@ git_vers_tag=$(git tag -l --points-at HEAD | grep ^v | sort -V | tail -n1)
52
52
53
53
# We could also include a short tag to follow semantic versioning, but it adds
54
54
# cleanup complexity, so we omit it for now.
55
- # git_rev_short=$(git rev-parse --revs-only --short HEAD)
55
+ git_rev_short=' '
56
+ if [ " ${WITH_GIT_SHORT_REV_TAG:- false} " == ' true' ]; then
57
+ git_rev_short=$( git rev-parse --revs-only --short HEAD)
58
+ fi
56
59
57
60
# Local image gets a :latest tag, always, for local dev/run convenience.
58
61
image_tag_args=" -t $imagename :latest"
@@ -70,6 +73,13 @@ if [ -n "$git_vers_tag" ]; then
70
73
fi
71
74
fi
72
75
76
+ if [ -n " $git_rev_short " ]; then
77
+ image_tag_args+=" -t $imagename :$git_rev_short "
78
+ if [ -n " $CONTAINER_REGISTRY_NAME " ]; then
79
+ image_tag_args+=" -t $CONTAINER_REGISTRY_NAME /$imagename :$git_rev_short "
80
+ fi
81
+ fi
82
+
73
83
docker_build_args=' '
74
84
if ! docker buildx version > /dev/null 2>&1 ; then
75
85
echo ' NOTE: docker buildkit is unavailable.' >&2
You can’t perform that action at this time.
0 commit comments