@@ -11,7 +11,9 @@ set -eu -o pipefail
11
11
: " ${PLATFORMS=} "
12
12
: " ${BASE=} "
13
13
: " ${TARGET=} "
14
+ : " ${BUILD_TAG=} "
14
15
16
+ defaultBase=" ubuntu"
15
17
versionTag=$( git describe --always --tags --match " v[0-9]*" )
16
18
17
19
if [[ ! " $versionTag " =~ ^v[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
83
85
if [ -n " $BASE " ]; then
84
86
tagNames=" $tagNames -$BASE "
85
87
fi
88
+ if [ -n " $BUILD_TAG " ]; then
89
+ tagNames=" $tagNames -$BUILD_TAG "
90
+ fi
91
+ if [ " $BASE " = " $defaultBase " ]; then
92
+ tagNames=" $tagNames $REPO :$TAG "
93
+ fi
86
94
87
95
if [[ " $versionTag " == " $TAG " ]]; then
88
96
if [ -n " $TARGET " ]; then
89
97
tagNames=" $tagNames $REPO :$TARGET "
90
98
if [ -n " $BASE " ]; then
91
99
tagNames=" $tagNames -$BASE "
92
100
fi
101
+ if [ -n " $BUILD_TAG " ]; then
102
+ tagNames=" $tagNames -$BUILD_TAG "
103
+ fi
104
+ if [ " $BASE " = " $defaultBase " ]; then
105
+ tagNames=" $tagNames $REPO :$TARGET "
106
+ fi
93
107
else
94
108
tagNames=" $tagNames $REPO :latest"
95
109
if [ -n " $BASE " ]; then
96
110
tagNames=" $tagNames -$BASE "
97
111
fi
112
+ if [ -n " $BUILD_TAG " ]; then
113
+ tagNames=" $tagNames -$BUILD_TAG "
114
+ fi
115
+ if [ " $BASE " = " $defaultBase " ]; then
116
+ tagNames=" $tagNames $REPO :latest"
117
+ fi
98
118
fi
99
119
fi
100
120
@@ -126,5 +146,11 @@ if [[ "$RELEASE" = "true" ]] && [[ "$GITHUB_ACTIONS" = "true" ]]; then
126
146
nocacheFilterFlag=" --no-cache-filter=buildkit-export,gobuild-base,rootless"
127
147
fi
128
148
149
+ if [ -n " $BUILD_TAG " ]; then
150
+ [ -n " $BUILDKITD_TAGS " ] && BUILDKITD_TAGS=" $BUILDKITD_TAGS "
151
+ BUILDKITD_TAGS=" $BUILDKITD_TAGS$BUILD_TAG "
152
+ export BUILDKITD_TAGS
153
+ fi
154
+
129
155
buildxCmd build --build-arg " BUILDKIT_CONTEXT_KEEP_GIT_DIR=1" --build-arg BUILDKITD_TAGS --build-arg BUILDKIT_DEBUG $exportBaseArg $platformFlag $targetFlag $importCacheFlags $exportCacheFlags $tagFlags $outputFlag $nocacheFilterFlag $attestFlags \
130
156
$currentcontext
0 commit comments