Merge pull request #8996 from zmstone/0917-fix-update-appup-script-usage

build(update-appup.sh): fix usage info
This commit is contained in:
Zaiming (Stone) Shi 2022-09-27 21:44:21 +02:00 committed by GitHub
commit 046eb727cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 5 deletions

View File

@ -7,12 +7,20 @@
set -euo pipefail
usage() {
echo "$0 PROFILE"
}
# ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
usage() {
echo "$0 PROFILE [options]"
echo "options:"
echo "--skip-build: Skip building the profile only to re-generate the appup files."
echo "--skip-build-base: This script by default forces a git clean before rebuilding on the base version "
echo " this option is useful when you are sure the past builds can be trusted,"
echo " that is, there were no re-tags or anything."
echo "--check: Exit with non-zero code if there is git diff after the execution."
echo " Mostly used in CI."
}
PROFILE="${1:-}"
case "$PROFILE" in
emqx-ee)
@ -48,7 +56,7 @@ ESCRIPT_ARGS=( '' )
while [ "$#" -gt 0 ]; do
case $1 in
-h|--help)
help
usage
exit 0
;;
--skip-build)
@ -100,7 +108,7 @@ else
pushd "${PREV_DIR_BASE}/${PREV_TAG}"
if [ "$NEW_COPY" = 'no' ]; then
REMOTE="$(git remote -v | grep "${GIT_REPO}" | head -1 | awk '{print $1}')"
git fetch "$REMOTE"
git fetch "$REMOTE" --tags -f
fi
git reset --hard
git clean -ffdx