34 lines
1.4 KiB
Bash
34 lines
1.4 KiB
Bash
|
#!/bin/bash
|
||
|
PRJ_NAME=prod107fnu-front-f
|
||
|
DOCKER_USER=risadmin_prod
|
||
|
DOCKER_PASS=$(sv get risadmin_prod dockerPassword)
|
||
|
DOCKER_URL=git.io8.dev
|
||
|
#********************
|
||
|
REPO_NAME=prod107fnu
|
||
|
GITEA_USER=risadmin_prod
|
||
|
GITEA_PASS=$(sv get risadmin_prod dockerPassword)
|
||
|
GITEA_EMAIL=ganeshk@dekatc.com
|
||
|
GIT_BRANCH=main
|
||
|
DOMAIN=git.io8.dev
|
||
|
#TARGET_PORT=9292
|
||
|
PATH_DIR=/data/24457_1726136166875/sureops_deploy/prod107fnu/sureops/prod107fnu-front-f/deployment
|
||
|
#**********************
|
||
|
cd $PATH_DIR
|
||
|
DOCKER_TAG=1.0
|
||
|
docker system prune -f
|
||
|
IMAGE_NAME=$DOCKER_USER/$PRJ_NAME:$DOCKER_TAG
|
||
|
# 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_USER/$PRJ_NAME:$DOCKER_TAG --build-arg BUILD_ID=$DOCKER_TAG --build-arg GITEA_PASS=$GITEA_PASS --build-arg GITEA_USER=$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
|
||
|
echo "Image deployed in container $PRJ_NAME"
|
||
|
|
||
|
curl -X GET "https://ops.io8.dev/sureops/suredocker/updaterepo?repoName=$REPO_NAME&packageName=$PRJ_NAME"
|