Skip to content

Commit 8b7ad02

Browse files
committed
Reorders tag release logic to prevent untracked files issue
1 parent 223e427 commit 8b7ad02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,11 @@ spec:
212212
git checkout ${BRANCH}
213213
git branch --set-upstream-to=origin/${BRANCH} ${BRANCH}
214214
215-
echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" > ./env-config
216-
217215
if [[ "${BRANCH}" == "master" ]] && [[ $(git describe --tag `git rev-parse HEAD`) =~ (^[0-9]+.[0-9]+.[0-9]+$) ]] || \
218216
[[ $(git describe --tag `git rev-parse HEAD`) =~ (^[0-9]+.[0-9]+.[0-9]+-.*[.][0-9]+$) ]]
219217
then
220218
echo "Latest commit is already tagged"
219+
echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" > ./env-config
221220
echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" >> ./env-config
222221
exit 0
223222
fi
@@ -242,6 +241,7 @@ spec:
242241
--verbose \
243242
-VV
244243
244+
echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" > ./env-config
245245
echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" >> ./env-config
246246
247247
cat ./env-config

0 commit comments

Comments
 (0)