1
0
Files
build.ems/pkg-front.sh
2025-03-20 18:38:19 +08:00

56 lines
1.2 KiB
Bash

#!/bin/bash
# front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3
ScpWeb="root@192.168.9.58"
BuildWeb=""
# back-end catalog
ApiBranch=main
# Package Catalog
BuildDir=/root/omc.git/build.ems
# Default Version Value
VERSION="2.2503.2"
# usage
usage() {
echo "Usage: bash $0 [OPTION]"
echo
echo "Build Software Package OPTION:"
echo " -v Specify the version"
echo " --web Build Web ($WebDir)"
echo " -h Display this help message"
echo
exit 1
}
# Read command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-v) VERSION="$2"; shift 2 ;;
--web) BuildWeb="build"; shift ;;
*) usage ;;
esac
done
# =================== Web
echo
# Determine if --web is passed in
if [ -n "$BuildWeb" ]; then
cd $WebDir
echo "===> web scp dist copy to $WebDir"
rm -rf $WebDir/dist
scp -r -P 18422 $ScpWeb:$WebDir/dist $WebDir/
output=$BuildDir/linux/usr/local/etc/omc/web
rm -rf $output
cp -rf dist/default/config.js dist/config.js
cp -rf dist $output
echo "===> web build dist copy to $output"
fi
# =================== deb/rpm
echo
bash $BuildDir/pkg.sh --api -apiBranch $ApiBranch -v $VERSION
# bash pkg-front.sh --web -v 2.2503.2
# bash pkg-front.sh -v 2.2503.2