1
0

feat: psap portal

This commit is contained in:
zhangsz
2025-04-15 11:42:08 +08:00
parent 4215a73c8c
commit 150d7aadbc
2 changed files with 16 additions and 13 deletions

View File

@@ -1,17 +1,17 @@
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 [OPTION] deb|badeb|rpm|psap" echo "Usage: $0 [OPTION] deb|badeb|rpm|psapdeb"
echo echo
echo "Build omc package, option as follow:" echo "Build omc package, option as follow:"
echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg" echo " deb|badeb|rpm, deb: ubuntu|debian package build by dpkg"
echo " badeb: ubuntu|debian package build by dpkg" echo " badeb: ubuntu|debian package build by dpkg"
echo " rpm: centos/redhat package, build by rpmbuild" echo " rpm: centos/redhat package, build by rpmbuild"
echo " psap psap package, build by dpkg" echo " psapdeb psap package, build by dpkg"
echo echo
echo " -r, =build root directory build root directory, default directory is $HOME/omc.git" echo " -r, =build root directory build root directory, default directory is $HOME/omc.git"
echo " -d dump SQL from database" echo " -d dump SQL from database"
echo " -h, --help display this help and exit" echo " -h, --help display this help and exit"
echo echo
} }
@@ -354,7 +354,7 @@ case "${pkgtype}" in
md5sum ${DebPkgName} >omc-md5sum.txt md5sum ${DebPkgName} >omc-md5sum.txt
echo "Finish to make ${pkgtype} package <======" echo "Finish to make ${pkgtype} package <======"
;; ;;
psap) psapdeb)
ProjectL="psap" ProjectL="psap"
echo "Begin to make ${pkgtype} package ======>" echo "Begin to make ${pkgtype} package ======>"
ReleasePkgDir=${ReleaseDir}/debs/${RelArch} ReleasePkgDir=${ReleaseDir}/debs/${RelArch}

View File

@@ -11,12 +11,19 @@ usage() {
echo " -m, =be|fe|all be: only process back-end code, default if non input" echo " -m, =be|fe|all be: only process back-end code, default if non input"
echo " fe: only process front-end code" echo " fe: only process front-end code"
echo " all: process all include be and fe" echo " all: process all include be and fe"
echo " -c, =ba ba: customized for BA OMC" echo " -c, =ba|psap ba: customized for BA OMC, psap: customized for PSAP Portal"
} }
pkgtype="" pkgtype=""
new_args=() new_args=()
be_args=() be_args=()
handle_invalid_option() {
echo "Invalid option: -$1" >&2
usage
exit 2
}
# Traverse all parameters # Traverse all parameters
for arg in "$@"; do for arg in "$@"; do
if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then if [[ "$arg" == "deb" || "$arg" == "rpm" ]]; then
@@ -54,19 +61,15 @@ while getopts "m:r:c:d" option; do
if [ "${c_arg}" == "ba" ]; then if [ "${c_arg}" == "ba" ]; then
pkgtype="badeb" pkgtype="badeb"
be_args+=("${pkgtype}") be_args+=("${pkgtype}")
else if [ "${c_arg}" == "psap" ]; then elif [ "${c_arg}" == "psap" ]; then
pkgtype="psapdeb" pkgtype="psapdeb"
be_args+=("${pkgtype}") be_args+=("${pkgtype}")
else else
echo "Invalid option: -$OPTARG" >&2 handle_invalid_option "$OPTARG"
usage fi
exit 2
fi
;; ;;
\?) \?)
echo "Invalid option: -$OPTARG" >&2 handle_invalid_option "$OPTARG"
usage
exit 2
;; ;;
esac esac
done done