This commit is contained in:
zhangkun9038@dingtalk.com 2022-09-10 10:46:04 +00:00
parent 852c55b516
commit 14d4970e82
3 changed files with 7 additions and 5 deletions

View File

@ -77,12 +77,12 @@ function main(){
echo "result $result"
if [ $result = 0 ];then
# uploadLog
echo "local temp file is same with oss fileno need to replace"
echo "local temp file ${fileName} is same with file in ${projectPath} no need to replace"
echo "ok: checkService done"
echo " "
exit 0
elif [ $result = 1 ]; then
echo "local temp file $fileName is different from oss, will download..."
echo "local temp file $fileName is different from ${projectPath}, will replace..."
else
exit 0
fi

View File

@ -6,6 +6,8 @@ projectPath=$2
PATH=PATH:/usr/bin:/usr/sbin
echo "1"
projectName="${fileName%.*}"
cd ~
echo "current path: $(pwd)"
if [ ! -f "$fileName" ];then

View File

@ -37,9 +37,6 @@ function compare(){
fi
echo "ossLength ${fileName} : "$ossLength
echo "curLength ${fileName} : "$curLength
logPath=${ossPath%/*}
logPath=${logPath%/*}/logs/
osslogPath=oss://ztupload/${logPath}autoDeploy.log
if [ "${ossLength}" = "${curLength}" ];then
return 0
else
@ -55,6 +52,9 @@ function process(){
}
# function uploadLog(){
# logPath=${ossPath%/*}
# logPath=${logPath%/*}/logs/
# osslogPath=oss://ztupload/${logPath}autoDeploy.log
# journalctl -n 1000 -xe -t autoDeploy > ~/autoDeploy.log
# if [ $? = 0 ];then
# echo "uploaded log to ${osslogPath}"