From d30a7d37b5a3c0a3b2e7fa895ce5ef214d270fda Mon Sep 17 00:00:00 2001 From: robbond Date: Fri, 6 Mar 2026 16:08:50 +0000 Subject: [PATCH] fix(ci): add default deploy environment variables for bash-safe pipeline --- Jenkinsfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 680a698..3b7d794 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,3 @@ -def DEPLOY_SSH_CREDENTIAL_ID = env.DEPLOY_SSH_CREDENTIAL_ID ?: 'plesk-agency-deploy-key' -def APP_HOST = env.APP_HOST ?: '192.168.68.89' -def APP_USER = env.APP_USER ?: 'deploy' -def DEPLOY_PATH = env.DEPLOY_PATH ?: '/opt/plesk-agency-portal' - pipeline { // Build + deploy stages require Docker CLI/daemon access on the Jenkins node. // Ensure this label maps to an agent with Docker installed and usable. @@ -12,6 +7,10 @@ pipeline { REGISTRY_IMAGE = "plesk-agency-portal" IMAGE_LATEST = "${REGISTRY_IMAGE}:latest" IMAGE_BUILD = "${REGISTRY_IMAGE}:build-${BUILD_NUMBER}" + DEPLOY_SSH_CREDENTIAL_ID = "${env.DEPLOY_SSH_CREDENTIAL_ID ?: 'plesk-agency-deploy-key'}" + APP_HOST = "${env.APP_HOST ?: '192.168.68.89'}" + APP_USER = "${env.APP_USER ?: 'deploy'}" + DEPLOY_PATH = "${env.DEPLOY_PATH ?: '/opt/plesk-agency-portal'}" } stages { @@ -74,7 +73,7 @@ pipeline { stage('Deploy') { steps { withCredentials([sshUserPrivateKey( - credentialsId: DEPLOY_SSH_CREDENTIAL_ID, + credentialsId: "${env.DEPLOY_SSH_CREDENTIAL_ID}", keyFileVariable: 'SSH_KEY' )]) { sh ''' -- 2.39.5