From 5aee8b9ecfb2a592d67ef6afef21037af4f24138 Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Fri, 16 Feb 2024 14:58:39 +0100 Subject: [PATCH] Only deploy from main branch --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 97e861e..6579b7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,6 +42,9 @@ pipeline { } } stage('Build docker image') { + when { + branch 'main' + } steps { echo 'Building image' script { @@ -52,6 +55,9 @@ pipeline { } } stage('Push image to container registry') { + when { + branch 'main' + } steps { echo 'Pushing image to registry' script { @@ -64,6 +70,9 @@ pipeline { } } stage('Notify CD script') { + when { + branch 'main' + } steps { echo 'Triggering deploy webhook' script {