fix(ci): add default deploy environment variables for bash-safe pipeline #41
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
@@ -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 '''
|
||||
|
||||
Reference in New Issue
Block a user