File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,16 @@ spec:
208
208
set -x
209
209
set -e
210
210
211
+ echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" > ./env-config
212
+
213
+ if [[ "${BRANCH}" == "master" ]] && [[ $(git describe --tag `git rev-parse HEAD`) =~ "^[0-9]+.[0-9]+.[0-9]+$" ]] || \
214
+ [[ $(git describe --tag `git rev-parse HEAD`) =~ "^[0-9]+.[0-9]+.[0-9]+-${BRANCH}.[0-9]+$" ]]
215
+ then
216
+ echo "Latest commit is already tagged"
217
+ echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" >> ./env-config
218
+ exit 0
219
+ fi
220
+
211
221
git fetch origin ${BRANCH} --tags
212
222
git checkout ${BRANCH}
213
223
git branch --set-upstream-to=origin/${BRANCH} ${BRANCH}
@@ -232,8 +242,7 @@ spec:
232
242
--verbose \
233
243
-VV
234
244
235
- echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" > ./env-config
236
- echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" >> ./env-config
245
+ echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" >> ./env-config
237
246
238
247
cat ./env-config
239
248
'''
You can’t perform that action at this time.
0 commit comments