Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release tag issue #4594

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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