From 291a3e314b48cb02e829eed7ef2234b325b87c11 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Sat, 10 Sep 2022 11:21:19 +0000 Subject: [PATCH] update --- checkService.sh | 6 +++--- ossUpgrade.sh | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/checkService.sh b/checkService.sh index ab7f015..914f7ae 100755 --- a/checkService.sh +++ b/checkService.sh @@ -8,7 +8,7 @@ fileName=$1 projectPath=$2 serviceName=$3 workDirectory=$4 -ossPath=$5 +ossLogPath=$5 PATH=PATH:/usr/bin:/usr/sbin @@ -16,7 +16,7 @@ function uploadLog () { echo "current user is ${USER}" journalctl -n 1000 -xe -t autoDeploy > ${workDirectory}autoDeploy.log - ${workDirectory}ossutil cp ${workDirectory}autoDeploy.log oss://ztupload/${ossPath}autoDeploy.log + ${workDirectory}ossutil cp ${workDirectory}autoDeploy.log oss://ztupload/${ossLogPath}autoDeploy.log if [ $? -ne 0 ]; then echo "error: upload log to oss failed!" exit 0 @@ -43,7 +43,7 @@ function compare(){ cd $projectPath desSum="" if [ ! -f "$fileName" ];then - cp ~/$fileName . + cp $workDirectory$fileName . return 0 else desSum=$(md5sum $fileName) diff --git a/ossUpgrade.sh b/ossUpgrade.sh index 8f734b9..86d566d 100755 --- a/ossUpgrade.sh +++ b/ossUpgrade.sh @@ -44,7 +44,7 @@ function compare(){ fi } -function process(){ +function downloadFromOss(){ cd ~ rm $fileName echo "fileName: " $fileName @@ -61,6 +61,16 @@ function process(){ # fi # } +# function isFrontEnd(){ + # result=$(echo $fileName | grep ".zip") + # if [[ "$result" != "" ]]; then + # return 0 + # else + # return 1 + # fi +# } + + function main(){ echo " " echo "start ossUpgrade service" @@ -77,10 +87,16 @@ function main(){ echo "local temp file $fileName is different from oss, will download..." fi - process - sleep 10 + downloadFromOss # uploadLog - echo "replaced" + echo "local temp file replaced" + # isFrontEnd + # result=$? + # if [ $result = 0 ];then + # preName=${fileName%/*} + # echo "frontEnd package ${preName} will cover to projectPath" +# + # fi echo "end ossUpgrade service" echo " " }