From 1958018938b59b1fad41ec1cd30bd8fb263af9c2 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 15:34:36 +0800 Subject: [PATCH] ... --- dsl/001sync_code.sh | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 6db4fc8..5bd2f43 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -77,12 +77,27 @@ source_build() { echo -e "$echoPrefix gradle build -x test $echoSuffix" gradle build -x test echo "" + + # 构建 yvan-ui + echo -e "$echoPrefix cd $source_path/yvan-ui $echoSuffix" + cd $source_path/yvan-ui + echo -e "$echoPrefix yarn run build_only $echoSuffix" + yarn run build_only } target_pull() { pullCode $target_path ${target_git} ${target_branch} ${target_position} } +target_build() { + # 构建 java + echo -e "$echoPrefix cd $target_path $echoSuffix" + cd $target_path + echo -e "$echoPrefix gradle build -x test $echoSuffix" + gradle build -x test + echo "" +} + sync_files() { echo -e "$echoPrefix 开始同步: $source_path $echoSuffix" rsync -azr --progress --delete \ @@ -140,15 +155,36 @@ sync_files() { echo -e "$echoPrefix 同步完成 $echoSuffix" echo -e "$echoPrefix 开始同步 lib $echoSuffix" - rsync -azr --progress --include '/yvan-*' --include '/wms-core-*' --include '/wms-api-*' --exclude='*' $source_path/wms-modules/wms-system/build/libs/lib/ $target_path/libs + rsync -azr --progress \ + --include '/yvan-*' \ + --include '/wms-core-*' \ + --include '/wms-api-*' \ + --exclude='*' \ + $source_path/wms-modules/wms-system/build/libs/lib/ $target_path/libs + echo -e "$echoPrefix 同步完成 $echoSuffix" + + echo -e "$echoPrefix 开始同步 yvan-ui $echoSuffix" + rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" } +commit_target() { + echo -e "$echoPrefix cd $target_path $echoSuffix" + cd $target_path + echo -e "$echoPrefix git add . $echoSuffix" + git add . + echo -e "$echoPrefix git commit -m '代码同步' $echoSuffix" + git commit -m '代码同步' + echo -e "$echoPrefix git push origin $target_branch $echoSuffix" + git push origin $target_branch +} + source_pull -#source_build +source_build target_pull sync_files - +commit_target +target_build # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh)