-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Pipelines: Always read vars from git checkout (#4597)
* Always read vars from git checkout * FIx create chart
- Loading branch information
Showing
5 changed files
with
51 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
pushd stratos | ||
|
||
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 | ||
RELEASE_TAG=$(git describe) | ||
if [[ "${RELEASE_TAG}" != ${VERSION}* ]]; then | ||
echo "Error: Can not get tag for this release - got ${RELEASE_TAG}" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z ${TAG_SUFFIX} ]; then | ||
if [ "${TAG_SUFFIX}" != "null" ]; then | ||
echo "Adding tag suffix '$TAG_SUFFIX' to the latest tag." | ||
LATEST_TAG=${LATEST_TAG}-${TAG_SUFFIX} | ||
echo "The latest tag is now $LATEST_TAG." | ||
fi | ||
fi | ||
|
||
popd | ||
|
||
set +x | ||
echo "VERSION : ${VERSION}" | ||
echo "COMMIT_HASH : ${COMMIT_HASH}" | ||
echo "LATEST_TAG : ${LATEST_TAG}" | ||
echo "SOURCE_CODE_REPO : ${SOURCE_CODE_REPO}" | ||
echo "RELEASE_TAG : ${RELEASE_TAG}" | ||
set -x |