update jenkinfile

This commit is contained in:
2026-03-07 17:36:57 +00:00
parent edf6a88a60
commit ed6a38b8ea

5
Jenkinsfile vendored
View File

@@ -47,6 +47,9 @@ pipeline {
stage('Deploy via SSH') {
steps {
script {
env.DEPLOY_BRANCH = env.BRANCH_NAME ?: 'main'
}
sshagent(credentials: ['deploy-ssh-key']) {
sh """
ssh -o StrictHostKeyChecking=no ${env.DEPLOY_USER}@${env.DEPLOY_HOST} << 'DEPLOY_EOF'
@@ -56,7 +59,7 @@ pipeline {
# Clone or pull the repo (contains docker-compose.yml)
if [ -d .git ]; then
git fetch origin
git reset --hard origin/${env.BRANCH_NAME}
git reset --hard origin/${env.DEPLOY_BRANCH}
else
git clone ${env.GIT_REPO_URL} .
fi