From 9969d8b2cffd5dbbe389b13d1611f1df8ffd6178 Mon Sep 17 00:00:00 2001 From: Nana Janashia Date: Fri, 6 Nov 2020 12:49:54 +0000 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index be3eff1..e22f659 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,21 +1,32 @@ pipeline { agent none stages { - stage('build') { - steps { - script { - echo "Building the application..." - } - } - } stage('test') { steps { script { echo "Testing the application..." + echo "Executing pipeline for branch $BRANCH_NAME" + } + } + } + stage('build') { + when { + expression { + BRANCH_NAME == 'master' + } + } + steps { + script { + echo "Building the application..." } } } stage('deploy') { + when { + expression { + BRANCH_NAME == 'master' + } + } steps { script { echo "Deploying the application..."