1
0

fix: 更新构建脚本中的分支和版本信息

This commit is contained in:
TsMask
2025-05-16 14:29:38 +08:00
parent 952e55140b
commit 0fe95af9c3
4 changed files with 14 additions and 79 deletions

View File

@@ -29,6 +29,4 @@ cd omc.git && ls
bash pkg.sh --web --api -v 2.2503.2
# RemoveChinese
bash pkg-remove-chinese.sh --web --api -v 2.2503.2
# Place in upper directory for execution - Remote copy front-end files for packaging
bash pkg-copy-front.sh --web -v 2.2503.2
```

View File

@@ -1,62 +0,0 @@
#!/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
BuildBranch=main
# 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
# =================== build branch
echo
cd $BuildDir
git checkout .
git pull
git checkout $BuildBranch
git pull
# =================== 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 $output
echo "===> web build dist copy to $output"
fi
# =================== deb/rpm
echo
bash $BuildDir/pkg.sh --api -apiBranch $ApiBranch -v $VERSION
# bash pkg-copy-front.sh --web -v 2.2503.2
# bash pkg-copy-front.sh -v 2.2503.2

View File

@@ -10,9 +10,9 @@ ApiBranch=lichang
BuildApi=""
# Package Catalog
BuildDir=/root/omc.git/build.ems
BuildBranch=main
BuildBranch=lichang
# Default Version Value
VERSION="2.2503.2"
VERSION="2.2505.2"
# usage
usage() {

25
pkg.sh
View File

@@ -2,17 +2,17 @@
# front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3
WebBranch=main
WebBranch=lichang
BuildWeb=""
# back-end catalog
# back-end Catalog
ApiDir=/root/omc.git/be.ems
ApiBranch=main
ApiBranch=lichang
BuildApi=""
# Package Catalog
BuildDir=/root/omc.git/build.ems
BuildBranch=main
BuildBranch=lichang
# Default Version Value
VERSION="2.2503.2"
VERSION="2.2505.2"
# usage
usage() {
@@ -20,10 +20,8 @@ usage() {
echo
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 " --web Build Web ($WebDir) Branch ($WebBranch)"
echo " --api Build Api ($ApiDir) Branch ($ApiBranch)"
echo " -h Display this help message"
echo
exit 1
@@ -33,9 +31,7 @@ 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
@@ -47,6 +43,7 @@ git checkout .
git pull
git checkout $BuildBranch
git pull
echo "===> build checkout directory: $BuildDir"
# =================== Web
echo
@@ -58,6 +55,10 @@ if [ -n "$BuildWeb" ]; then
git checkout $WebBranch
git pull
# remote replication
# scpDir=/root/omc.git/fe.ems.vue3
# scp -r -P 18422 root@192.168.9.58:$WebScpDir/dist $WebDir/
# local compilation
npm install --registry https://registry.npmmirror.com
npm run build
@@ -105,8 +106,6 @@ 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