From 0fe95af9c356e2b52a28db9db46ef361605167b2 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 16 May 2025 14:29:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E6=9B=B4=E6=96=B0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84=E5=88=86=E6=94=AF=E5=92=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 -- pkg-copy-front.sh | 62 ------------------------------------------- pkg-remove-chinese.sh | 4 +-- pkg.sh | 25 +++++++++-------- 4 files changed, 14 insertions(+), 79 deletions(-) delete mode 100644 pkg-copy-front.sh diff --git a/README.md b/README.md index cbaa8da..8b1dfa5 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/pkg-copy-front.sh b/pkg-copy-front.sh deleted file mode 100644 index 7a06973..0000000 --- a/pkg-copy-front.sh +++ /dev/null @@ -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 diff --git a/pkg-remove-chinese.sh b/pkg-remove-chinese.sh index f87c312..0c9af3a 100644 --- a/pkg-remove-chinese.sh +++ b/pkg-remove-chinese.sh @@ -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() { diff --git a/pkg.sh b/pkg.sh index c436c9a..7cfc62a 100644 --- a/pkg.sh +++ b/pkg.sh @@ -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