update jenkinsfile

This commit is contained in:
2026-03-20 19:38:23 +00:00
parent 41173aa97e
commit 13fd652d1f

23
Jenkinsfile vendored
View File

@@ -60,26 +60,17 @@ pipeline {
if [ -f .env ]; then cp .env /tmp/.seasoned_env_bak; fi if [ -f .env ]; then cp .env /tmp/.seasoned_env_bak; fi
# Clone or pull the repo (contains docker-compose.yml) git fetch origin
if [ -d .git ]; then git reset --hard origin/${env.DEPLOY_BRANCH}
git fetch origin
git reset --hard origin/${env.DEPLOY_BRANCH}
else
git clone ${env.GIT_REPO_URL} .
fi
if [ -f /tmp/.seasoned_env_bak ]; then mv /tmp/.seasoned_env_bak .env; fi if [ -f /tmp/.seasoned_env_bak ]; then mv /tmp/.seasoned_env_bak .env; fi
if [ ! -f .env ]; then echo "WARNING: .env file is missing on server!"; fi
# Set the image tag for this deployment
export IMAGE_TAG=${env.IMAGE_TAG} export IMAGE_TAG=${env.IMAGE_TAG}
export DOCKER_REGISTRY=${env.DOCKER_REGISTRY} export DOCKER_REGISTRY=${env.DOCKER_REGISTRY}
export DOCKER_IMAGE=${env.DOCKER_IMAGE} export DOCKER_IMAGE=${env.DOCKER_IMAGE}
# Pull latest image and deploy docker compose --env-file .env pull
docker compose pull docker compose --env-file .env up -d --force-recreate
docker compose up -d
DEPLOY_EOF DEPLOY_EOF
""" """
} }