#!/bin/bash PRJ_NAME=testnew-back-b DOCKER_USER=new_1743500994930 DOCKER_PASS=$(sv get new_1743500994930 dockerPassword) DOCKER_URL=157.66.191.31:3000 #******************** REPO_NAME=testnew GITEA_USER=new_1743500994930 GITEA_PASS=$(sv get new_1743500994930 dockerPassword) GITEA_EMAIL=patilkiranv1997@gmail.com GIT_BRANCH=main DOMAIN=157.66.191.31:3000 #WEB-URL-PORT CONT_PORT=3306 TARGET_PORT=9292 PATH_DIR=/data/35673_1743501266907/sureops_deploy/testnew/sureops/testnew-back-b/deployment #********************** cd $PATH_DIR DOCKER_TAG=1.0 #docker system prune -f # Stop any existing containers with the same name and ports docker stop $PRJ_NAME >/dev/null 2>&1 || true docker rm $PRJ_NAME >/dev/null 2>&1 || true # Build and push the Docker image DOCKER_BUILDKIT=0 docker build --no-cache -t $DOCKER_URL/$DOCKER_USER/$PRJ_NAME:$DOCKER_TAG --build-arg $GITEA_PASS --build-arg $GITEA_USER . docker login --username=$DOCKER_USER --password=$DOCKER_PASS $DOCKER_URL docker tag $DOCKER_URL/$DOCKER_USER/$PRJ_NAME:$DOCKER_TAG $DOCKER_URL/$DOCKER_USER/$PRJ_NAME docker push $DOCKER_URL/$DOCKER_USER/$PRJ_NAME docker push $DOCKER_URL/$DOCKER_USER/$PRJ_NAME:$DOCKER_TAG docker logout $DOCKER_URL #docker system prune -f # Deploy the image in a Docker container #docker run -d --name $PRJ_NAME -p $CONT_PORT:$TARGET_PORT $DOCKER_USER/$PRJ_NAME:$DOCKER_TAG curl -X GET "http://157.66.191.31:31170/sureops/suredocker/updaterepo?repoName=$REPO_NAME&packageName=$PRJ_NAME"