diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/honestyui-build.sh b/honestyui-build.sh index 1bfe92c..eca60f3 100755 --- a/honestyui-build.sh +++ b/honestyui-build.sh @@ -1,14 +1,25 @@ #!/bin/bash +source .env echo "Content-type: text/html" echo "" +COMMIT=$(git -C /mnt/vol2/cicd/Fishie-Honesty-UI log -n 1 --abbrev=7 --pretty=format:"%h") +TGTEXT=$(echo Deployment Triggered %0A $(date "+%H:%M:%S %a %b %d %Y") %0A Current Commit id: $(echo $COMMIT) | sed "s/ /%20/g") +curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$HONESTY_TG_CHATID'&'text=$TGTEXT + git -C /mnt/vol2/cicd/Fishie-Honesty-UI pull + docker compose -f /mnt/vol2/cicd/Fishie-Honesty-UI/.build/docker-compose.yml build docker compose -f /mnt/vol2/cicd/Fishie-Honesty-UI/.build/docker-compose.yml push docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml pull docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml down docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml up -d + +COMMIT=$(git -C /mnt/vol2/cicd/Fishie-Honesty-UI log -n 1 --abbrev=7 --pretty=format:"%h") +TGTEXT=$(echo Deployment Completed %0A $(date "+%H:%M:%S %a %b %d %Y") %0A New Commit id: $(echo $COMMIT) | sed "s/ /%20/g") +curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$HONESTY_TG_CHATID'&'text=$TGTEXT + echo "" echo "prolly done, check for yourself"