Compare commits

..

5 Commits

Author SHA1 Message Date
778527807d bingtg build and logs 2023-04-14 17:16:03 +05:00
770e88d01f bingtg build and logs 2023-04-14 17:14:47 +05:00
4c1f49df3e fix output to neat 2023-04-14 17:01:25 +05:00
a2a4909a9a ffs build api not ui 2023-04-14 02:50:09 +05:00
7ac34180b6 wrong build path 2023-04-14 02:34:22 +05:00
7 changed files with 88 additions and 3 deletions

33
bingtg-build.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
source .env
GIT_PATH=$BING_TG_GIT_PATH
DOCKER_BUILD_PATH=$BING_TG_DOCKER_BUILD_PATH
DOCKER_RUN_PATH=$BING_TG_DOCKER_RUN_PATH
TG_CHATID=$BING_TG_TG_CHATID
TG_BOT_TOKEN=$BING_TG_TG_BOT_TOKEN
echo "Content-type: text/plain"
echo ""
COMMIT_ID=$(git -C $GIT_PATH log -n 1 --abbrev=7 --pretty=format:"%h")
COMMIT_MSG=$(git -C $GIT_PATH log -1 --pretty=format:"%s%n%b")
COMMIT_BY=$(git -C $GIT_PATH log -1 --pretty=format:%an)
TGTEXT=$(echo Deployment Triggered %0A $(date "+%H:%M:%S %a %b %d %Y") %0A%0A Current Commit by: $COMMIT_BY %0A ID: $COMMIT_ID %0A Message: $COMMIT_MSG | sed "s/ /%20/g")
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=$TGTEXT
git -C $GIT_PATH pull
docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml build
docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml push
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml pull
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml down
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml up -d
COMMIT_ID=$(git -C $GIT_PATH log -n 1 --abbrev=7 --pretty=format:"%h")
COMMIT_MSG=$(git -C $GIT_PATH log -1 --pretty=format:"%s%n%b")
COMMIT_BY=$(git -C $GIT_PATH log -1 --pretty=format:%an)
TGTEXT=$(echo Deployment Completed %0A $(date "+%H:%M:%S %a %b %d %Y") %0A%0A New Commit by: $COMMIT_BY %0A ID: $COMMIT_ID %0A Message: $COMMIT_MSG | sed "s/ /%20/g")
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=$TGTEXT
echo ""
echo "prolly done, check for yourself"

10
bingtg-logs.cgi Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
source .env
DOCKER_RUN_PATH=$BING_TG_DOCKER_RUN_PATH
echo "Content-type: text/plain"
echo ""
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml logs

3
cgi-bin/bingtg-logs.cgi Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
$(pwd)/bingtg-logs.cgi

3
cgi-bin/trigger-bing-build.cgi Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
$(pwd)/bingtg-build.sh

View File

@@ -0,0 +1,3 @@
#!/bin/bash
$(pwd)/honestyapi-build.sh

33
honestyapi-build.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
source .env
GIT_PATH=$HONESTY_API_GIT_PATH
DOCKER_BUILD_PATH=$HONESTY_API_DOCKER_BUILD_PATH
DOCKER_RUN_PATH=$HONESTY_API_DOCKER_RUN_PATH
TG_CHATID=$HONESTY_TG_CHATID
echo "Content-type: text/plain"
echo ""
COMMIT_ID=$(git -C $GIT_PATH log -n 1 --abbrev=7 --pretty=format:"%h")
COMMIT_MSG=$(git -C $GIT_PATH log -1 --pretty=format:"%s%n%b")
COMMIT_BY=$(git -C $GIT_PATH log -1 --pretty=format:%an)
TGTEXT=$(echo Deployment Triggered %0A $(date "+%H:%M:%S %a %b %d %Y") %0A%0A Current Commit by: $COMMIT_BY %0A ID: $COMMIT_ID %0A Message: $COMMIT_MSG | sed "s/ /%20/g")
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$HONESTY_TG_CHATID'&'text=$TGTEXT
git -C $GIT_PATH pull
docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml build
#docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml push
#docker compose -f $DOCKER_RUN_PATH/docker-compose.yml pull
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml down
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml up -d
COMMIT_ID=$(git -C $GIT_PATH log -n 1 --abbrev=7 --pretty=format:"%h")
COMMIT_MSG=$(git -C $GIT_PATH log -1 --pretty=format:"%s%n%b")
COMMIT_BY=$(git -C $GIT_PATH log -1 --pretty=format:%an)
TGTEXT=$(echo Deployment Completed %0A $(date "+%H:%M:%S %a %b %d %Y") %0A%0A New Commit by: $COMMIT_BY %0A ID: $COMMIT_ID %0A Message: $COMMIT_MSG | sed "s/ /%20/g")
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=$TGTEXT
echo ""
echo "prolly done, check for yourself"

View File

@@ -6,7 +6,7 @@ DOCKER_BUILD_PATH=$HONESTY_UI_DOCKER_BUILD_PATH
DOCKER_RUN_PATH=$HONESTY_UI_DOCKER_RUN_PATH
TG_CHATID=$HONESTY_TG_CHATID
echo "Content-type: text/html"
echo "Content-type: text/plain"
echo ""
COMMIT_ID=$(git -C $GIT_PATH log -n 1 --abbrev=7 --pretty=format:"%h")
@@ -17,8 +17,8 @@ curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$HONESTY_TG_CHATID'&'text=$T
git -C $GIT_PATH pull
docker compose -f $DOCKER_BUILD_PATH/.build/docker-compose.yml build
docker compose -f $DOCKER_BUILD_PATH/.build/docker-compose.yml push
docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml build
docker compose -f $DOCKER_BUILD_PATH/docker-compose.yml push
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml pull
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml down
docker compose -f $DOCKER_RUN_PATH/docker-compose.yml up -d