perf: 构建工具调整

This commit is contained in:
TsMask
2025-03-18 15:07:21 +08:00
parent 8d7956a4c9
commit 07e4d3fa63
2 changed files with 10 additions and 8 deletions

View File

@@ -36,9 +36,11 @@ standardEnv() {
fi fi
} }
# customize # Different processing depending on the value of customize
customize() { customize() {
echo "customize" cp -rf $OMCEtcDir/vendor/$C_PARAM/web/* $OMCEtcDir/web/background
cp -rf $OMCEtcDir/vendor/$C_PARAM/static/* /usr/local/$C_PARAM/static
$OMCBinFile -c $confFile --sqlPath $OMCEtcDir/vendor/$C_PARAM/database/$DBSource/customized.sql --sqlSource $MODE
} }
# ========================= # =========================
@@ -86,7 +88,7 @@ echo "Type parameter: $T_PARAM"
# Determine if -m is passed in # Determine if -m is passed in
if [ -n "$M_PARAM" ]; then if [ -n "$M_PARAM" ]; then
# Check that mode is within the standard range # Check that mode is within the standard range
if [[ "$mode" != "standard" && "$mode" != "lite" ]]; then if [[ "$M_PARAM" != "standard" && "$M_PARAM" != "lite" ]]; then
echo "Error: -m can only be 'standard' or 'lite'." echo "Error: -m can only be 'standard' or 'lite'."
exit 1 exit 1
fi fi
@@ -100,7 +102,7 @@ echo "Mode parameter: $MODE"
# Determine if -c is passed in # Determine if -c is passed in
if [ -n "$C_PARAM" ]; then if [ -n "$C_PARAM" ]; then
# Check if customize is within the standard # Check if customize is within the standard
if [[ "$customize" != "omc" && "$customize" != "agt" && "$customize" != "ba" ]]; then if [[ "$C_PARAM" != "omc" && "$C_PARAM" != "agt" && "$C_PARAM" != "ba" ]]; then
echo "Error: -c can only be 'omc', 'agt' or 'ba'." echo "Error: -c can only be 'omc', 'agt' or 'ba'."
exit 1 exit 1
fi fi

8
pkg.sh
View File

@@ -27,7 +27,7 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
# =================== # =================== Web
echo echo
# Determine if -web is passed in # Determine if -web is passed in
if [ -n "$BuildWeb" ]; then if [ -n "$BuildWeb" ]; then
@@ -44,7 +44,7 @@ fi
cd $RootDir cd $RootDir
# =================== # =================== sshsvc
echo echo
cd $RootDir/sshsvc cd $RootDir/sshsvc
make make
@@ -53,7 +53,7 @@ cp -rf sshsvc $RootDir/build/linux/usr/local/bin/sshsvc
echo "===> go build sshsvc copy to /build/linux/usr/local/bin" echo "===> go build sshsvc copy to /build/linux/usr/local/bin"
# =================== # =================== omc
echo echo
MOD_CONFIG="be.ems/src/framework/config" MOD_CONFIG="be.ems/src/framework/config"
go build -o omc -v -ldflags "-s -w -X '$MOD_CONFIG.Version=$VERSION' -X '$MOD_CONFIG.BuildTime=$(date)' -X '$MOD_CONFIG.GoVer=$(go version)'" go build -o omc -v -ldflags "-s -w -X '$MOD_CONFIG.Version=$VERSION' -X '$MOD_CONFIG.BuildTime=$(date)' -X '$MOD_CONFIG.GoVer=$(go version)'"
@@ -62,6 +62,6 @@ cp -rf omc $RootDir/build/linux/usr/local/bin/omc
echo "===> go build omc copy to /build/linux/usr/local/bin" echo "===> go build omc copy to /build/linux/usr/local/bin"
# =================== # =================== deb/rpm
echo echo
bash $RootDir/build/build.sh -v $VERSION bash $RootDir/build/build.sh -v $VERSION