From 8f2add082030c71e3d4b5f9f3b72c9cd1da337a3 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Thu, 24 Oct 2024 13:49:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E7=BD=B2=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=83=A8=E7=BD=B2=E5=8D=8E=E4=B8=BA=E4=BA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/build_and_deploy.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/k8s/build_and_deploy.sh b/k8s/build_and_deploy.sh index 378041c4..08e3d338 100755 --- a/k8s/build_and_deploy.sh +++ b/k8s/build_and_deploy.sh @@ -3,10 +3,6 @@ #记录开始时间 startTime=$(date +%s) -# 登录到目标环境 -baseDir="/data/code/manage-platform" -cd ${baseDir} - #build # 默认参数 @@ -50,6 +46,13 @@ if [[ ! " ${valid_envs[@]} " =~ " $env " ]]; then exit 1 fi +git stash +git checkout $branch + +# 登录到目标环境 +baseDir="/data/code/manage-platform" +cd ${baseDir} + echo "start build" sh ${baseDir}/k8s/build.sh -b ${branch} -s ${service} if [ $? -ne 0 ]; then