tg notifications

This commit is contained in:
Shihaam Abdul Rahman 2023-04-11 11:32:44 +05:00
parent 74a2132f41
commit d8f30dd1c0
Signed by: shihaam
GPG Key ID: 1D33DF08702F2A9C
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -1,14 +1,25 @@
#!/bin/bash #!/bin/bash
source .env
echo "Content-type: text/html" echo "Content-type: text/html"
echo "" 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 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 build
docker compose -f /mnt/vol2/cicd/Fishie-Honesty-UI/.build/docker-compose.yml push 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 pull
docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml down docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml down
docker compose -f /mnt/vol3/www/honestyui/docker-compose.yml up -d 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 ""
echo "prolly done, check for yourself" echo "prolly done, check for yourself"