bingtg build and logs
This commit is contained in:
		
							
								
								
									
										33
									
								
								bingtg-build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										33
									
								
								bingtg-build.sh
									
									
									
									
									
										Executable 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" | ||||
							
								
								
									
										3
									
								
								cgi-bin/bingtg-logs.cgi
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								cgi-bin/bingtg-logs.cgi
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| $(pwd)/bingtg-logs.cgi | ||||
							
								
								
									
										3
									
								
								cgi-bin/trigger-bing-build.cgi
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								cgi-bin/trigger-bing-build.cgi
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| $(pwd)/bingtg-build.sh | ||||
		Reference in New Issue
	
	Block a user