Merge pull request #13330 from zmstone/0625-chore-improve-cut.sh
chore: improve rel/cut.sh
This commit is contained in:
commit
debad00e82
|
@ -142,6 +142,21 @@ rel_branch() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_profile() {
|
||||||
|
local tag="$1"
|
||||||
|
local allowed_prefix
|
||||||
|
if [ -f .emqx-platform ]; then
|
||||||
|
allowed_prefix='e'
|
||||||
|
else
|
||||||
|
allowed_prefix='v'
|
||||||
|
fi
|
||||||
|
if [[ "${tag}" != "${allowed_prefix}"* ]]; then
|
||||||
|
logerr "Expecting a '${allowed_prefix}' tag on this commit"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
assert_profile "$TAG"
|
||||||
|
|
||||||
## Ensure the current work branch
|
## Ensure the current work branch
|
||||||
assert_work_branch() {
|
assert_work_branch() {
|
||||||
local tag="$1"
|
local tag="$1"
|
||||||
|
@ -283,6 +298,10 @@ if [ "$DRYRUN" = 'yes' ]; then
|
||||||
else
|
else
|
||||||
git tag "$TAG"
|
git tag "$TAG"
|
||||||
logmsg "$TAG is created OK."
|
logmsg "$TAG is created OK."
|
||||||
logwarn "Don't forget to push the tag! to both emqx.git and emqx-platform.git"
|
PUSH_TO="both emqx.git and emqx-platform.git!"
|
||||||
|
if [ -f .emqx-platform ]; then
|
||||||
|
PUSH_TO="emqx-platform.git but NOT emqx.git!"
|
||||||
|
fi
|
||||||
|
logwarn "Don't forget to push the tag to ${PUSH_TO}"
|
||||||
echo "git push origin $TAG"
|
echo "git push origin $TAG"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue