1
0

ref: 打包脚本调整

This commit is contained in:
TsMask
2025-03-20 18:38:19 +08:00
parent 5160e85804
commit e363529519
4 changed files with 72 additions and 9 deletions

14
pkg.sh
View File

@@ -2,11 +2,11 @@
# front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3
WebBranch=lichang
WebBranch=main
BuildWeb=""
# back-end catalog
ApiDir=/root/omc.git/be.ems
ApiBranch=lichang
ApiBranch=main
BuildApi=""
# Package Catalog
BuildDir=/root/omc.git/build.ems
@@ -20,7 +20,9 @@ usage() {
echo "Build Software Package OPTION:"
echo " -v Specify the version"
echo " --web Build Web ($WebDir)"
echo " -webBranch Web Branch ($WebBranch)"
echo " --api Build Api ($ApiDir)"
echo " -apiBranch Api Branch ($ApiBranch)"
echo " -h Display this help message"
echo
exit 1
@@ -30,7 +32,9 @@ while [[ $# -gt 0 ]]; do
case "$1" in
-v) VERSION="$2"; shift 2 ;;
--web) BuildWeb="build"; shift ;;
-webBranch) WebBranch="$2"; shift 2 ;;
--api) BuildApi="build"; shift ;;
-apiBranch) ApiBranch="$2"; shift 2 ;;
*) usage ;;
esac
done
@@ -82,8 +86,8 @@ if [ -n "$BuildApi" ]; then
output=$BuildDir/linux/usr/local/etc/omc
dirs="database default vendor"
for v in ${dirs}; do
rm -rf ${output}/${v}
cp -rf ${ApiDir}/build/${v} ${output}/${v}
rm -rf ${output}/${v}
cp -rf ${ApiDir}/build/${v} ${output}/${v}
done
echo
echo "===> vendor data copy to $output"
@@ -94,6 +98,8 @@ echo
bash $BuildDir/build.sh -v $VERSION
# Compile the front-end and back-end and then package the version
# bash pkg.sh --web -webBranch main --api -apiBranch main -v 2.2503.2
# bash pkg.sh --web --api -v 2.2503.2
# bash pkg.sh --api -apiBranch main -v 2.2503.2
# Packaged version of just the last compiled file/build directory
# bash pkg.sh -v 2.2503.2