Commit df182010 authored by Abdullah Khabir's avatar Abdullah Khabir
Browse files

بِسْمِ ٱللّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيم - In the name of Allah SWT, the most...

بِسْمِ ٱللّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيم - In the name of Allah SWT, the most Gracious, the most Merciful.
parents
pipeline {
agent any
environment {
DEPLOY_PATH_PH = "/path/to/ph/deploy"
DEPLOY_PATH_PD = "/path/to/pd/deploy"
}
stages {
stage('Check for Tag') {
when {
expression { return env.GIT_TAG != null && env.GIT_TAG != "" }
}
steps {
script {
// Check if the tag starts with 'ph'
if (env.GIT_TAG.startsWith('ph')) {
echo "Tag starts with 'ph'. Deploying 'ph'..."
deployPH()
}
// Check if the tag starts with 'pd'
else if (env.GIT_TAG.startsWith('pd')) {
echo "Tag starts with 'pd'. Deploying 'pd'..."
deployPD()
} else {
echo "Tag does not match 'ph' or 'pd'. Skipping deployment."
}
}
}
}
}
post {
always {
echo "Pipeline execution finished."
}
}
}
def deployPH() {
// Insert your deployment logic for 'ph' here
echo "Deploying PH: $DEPLOY_PATH_PH"
// Example command to deploy
// sh "deploy-command --target ${DEPLOY_PATH_PH}"
}
def deployPD() {
// Insert your deployment logic for 'pd' here
echo "Deploying PD: $DEPLOY_PATH_PD"
// Example command to deploy
// sh "deploy-command --target ${DEPLOY_PATH_PD}"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment