diff --git a/app/deploy_prod.sh b/app/deploy_prod.sh index 3468753..744701b 100755 --- a/app/deploy_prod.sh +++ b/app/deploy_prod.sh @@ -1,28 +1,18 @@ #!/bin/bash -FILE_NAME="web_cgdj_h5" -REMOTE_FILE_PATH="/home/server2/web_cgdj/h5/" -TAG_NAME="web_cgdj_h5.tar.gz" - set -e -set -o -function send_msg() { - msg="@jscdsndj @xiuyuan_Lee @steven0yu %0A服务:SERVER2  站点-cgdj-H5 %0A更新内容:$content%0A创建时间: $(date +%F_%X)%0A操作人:$(git config user.name)" - curl -X POST "https://api.telegram.org/bot6357085965:AAEmXfjZnZwnDTicL7Wjbd7cXvYv_G98w8A/sendMessage" -d "chat_id=$1&text=$msg" >/dev/null 2>&1 -} +echo "开始" +rm -rf ./web_huangguo2_h5 ./web_huangguo2_h5.tar.gz +GOOS=linux GOARCH=amd64 go build -o web_huangguo2_h5 +tar zvcf web_huangguo2_h5.tar.gz \ + --exclude='template/pages/sitemaps/sitemap.xml' \ + --exclude='template/pages/sitemaps/sitemap-*.xml' \ + --exclude='template/pages/rss.xml' \ + --exclude='template/pages/llms.txt' \ + --exclude='template/pages/llms-full.txt' \ + web_huangguo2_h5 template/ static/ conf/ -read -p "输入yes, 开始上传: " word -if [[ ! "yes" =~ $word ]]; then - echo "终止" -else - read -e -p "本次更新内容(输入q退出编辑): " -r content - echo "开始" - rm -rf ./$FILE_NAME ./$TAG_NAME ./yinsemd5.txt - GOOS=linux GOARCH=amd64 go build -o $FILE_NAME - md5sum $FILE_NAME | cut -d ' ' -f1 >yinsemd5.txt - tar zvcf $TAG_NAME ./$FILE_NAME yinsemd5.txt - md5sum $TAG_NAME | cut -d ' ' -f1 >yinsemd5.txt - scp -i ~/.ssh/id_rsa -P 22889 ./yinsemd5.txt server2@116.212.120.2:$REMOTE_FILE_PATH - scp -i ~/.ssh/id_rsa -P 22889 ./$TAG_NAME server2@116.212.120.2:$REMOTE_FILE_PATH - send_msg -4791758991 #服务器小组 -fi -rm -rf ./$FILE_NAME ./$TAG_NAME ./yinsemd5.txt + +scp web_huangguo2_h5.tar.gz root@172.104.166.87:/data/uzip +ssh root@172.104.166.87 "/server/web_huangguo2/h5/up_app.sh" + +rm -rf ./web_huangguo2_h5 ./web_huangguo2_h5.tar.gz \ No newline at end of file