Skip to content

Commit

Permalink
Fix release tag issue (#4594)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored Sep 21, 2020
1 parent 85045f3 commit 65dad73
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deploy/ci/tasks/dev-releases/generate-tag-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ run:
cd stratos
# RELEASE_TAG is the full tag that started the pipleine, e.g. '2.0.0-rc.1'
RELEASE_TAG=$(cat .git/ref)
# RELEASE_TAG is the full tag that started the pipleinee, e.g. '2.0.0-rc.1'
VERSION=$(cat package.json | grep version | grep -Po "([0-9\.]?)*")
COMMIT_HASH=$(git log -1 --format="%h")
LATEST_TAG=$VERSION-${COMMIT_HASH}
SOURCE_CODE_REPO=$(git config --get remote.origin.url)
# Check that the RELEASE_TAG matches the version
if [[ "${RELEASE_TAG}" != ${VERSION}* ]]; then
echo ".git/ref is not the expected release tag - falling back to git describe"
RELEASE_TAG=$(git describe)
if [[ "${RELEASE_TAG}" != ${VERSION}* ]]; then
echo "Error: Can not get tag for this release - got ${RELEASE_TAG}"
exit 1
fi
fi
echo "Got Release tag ${RELEASE_TAG}"
echo "Got version $VERSION from package.json."
echo "Got $LATEST_TAG as the latest git tag."
Expand Down

0 comments on commit 65dad73

Please sign in to comment.