From ed6a38b8ea7802274a019035ea92b040fae41f8d Mon Sep 17 00:00:00 2001 From: ryanv Date: Sat, 7 Mar 2026 17:36:57 +0000 Subject: [PATCH] update jenkinfile --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 79117d0..140b0f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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