build(update-appup.sh): fix usage info

This commit is contained in:
Zaiming (Stone) Shi 2022-09-17 14:50:46 +02:00
parent 8b7726df4e
commit 68d28fdcdd
1 changed files with 13 additions and 5 deletions

View File

@ -7,12 +7,20 @@
set -euo pipefail set -euo pipefail
usage() {
echo "$0 PROFILE"
}
# ensure dir # ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." 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:-}" PROFILE="${1:-}"
case "$PROFILE" in case "$PROFILE" in
emqx-ee) emqx-ee)
@ -48,7 +56,7 @@ ESCRIPT_ARGS=( '' )
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
case $1 in case $1 in
-h|--help) -h|--help)
help usage
exit 0 exit 0
;; ;;
--skip-build) --skip-build)
@ -100,7 +108,7 @@ else
pushd "${PREV_DIR_BASE}/${PREV_TAG}" pushd "${PREV_DIR_BASE}/${PREV_TAG}"
if [ "$NEW_COPY" = 'no' ]; then if [ "$NEW_COPY" = 'no' ]; then
REMOTE="$(git remote -v | grep "${GIT_REPO}" | head -1 | awk '{print $1}')" REMOTE="$(git remote -v | grep "${GIT_REPO}" | head -1 | awk '{print $1}')"
git fetch "$REMOTE" git fetch "$REMOTE" --tags -f
fi fi
git reset --hard git reset --hard
git clean -ffdx git clean -ffdx