Skip to content
Snippets Groups Projects
Commit cc336f43 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3420 skip scm build

parent 9718d1ac
Branches
Tags
No related merge requests found
import groovy.json.JsonOutput import groovy.json.JsonOutput
def SKIP_RUN = false
pipeline { pipeline {
agent { agent {
node { node {
...@@ -31,13 +33,26 @@ pipeline { ...@@ -31,13 +33,26 @@ pipeline {
} }
stages { stages {
stage('Checkout SCM') { stage('Checkout build trigger') {
when { when {
anyOf { not {
triggeredBy 'BuildUpstreamCause' triggeredBy 'BuildUpstreamCause'
}
not {
triggeredBy cause: "UserIdCause" triggeredBy cause: "UserIdCause"
} }
} }
steps {
script {
SKIP_RUN = true
currentBuild.result= "ABORTED"
}
}
}
stage('Checkout SCM') {
when {
expression { !SKIP_RUN }
}
steps { steps {
script { script {
FAILED_STAGE = env.STAGE_NAME FAILED_STAGE = env.STAGE_NAME
...@@ -48,10 +63,7 @@ pipeline { ...@@ -48,10 +63,7 @@ pipeline {
} }
stage("Clone Gitops Repo") { stage("Clone Gitops Repo") {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -64,10 +76,7 @@ pipeline { ...@@ -64,10 +76,7 @@ pipeline {
stage("Init Default Versions") { stage("Init Default Versions") {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -82,6 +91,7 @@ pipeline { ...@@ -82,6 +91,7 @@ pipeline {
stage("Set User Versions") { stage("Set User Versions") {
when { when {
expression { !SKIP_RUN }
beforeInput true beforeInput true
triggeredBy cause: "UserIdCause" triggeredBy cause: "UserIdCause"
} }
...@@ -106,10 +116,7 @@ pipeline { ...@@ -106,10 +116,7 @@ pipeline {
stage("Install Cypress") { stage("Install Cypress") {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -130,10 +137,7 @@ pipeline { ...@@ -130,10 +137,7 @@ pipeline {
stage('Init k8s') { stage('Init k8s') {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -151,10 +155,7 @@ pipeline { ...@@ -151,10 +155,7 @@ pipeline {
stage('Rollout E2E Namespaces') { stage('Rollout E2E Namespaces') {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -183,10 +184,7 @@ pipeline { ...@@ -183,10 +184,7 @@ pipeline {
stage('Run E2E-Tests') { stage('Run E2E-Tests') {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
failFast false failFast false
...@@ -249,10 +247,7 @@ pipeline { ...@@ -249,10 +247,7 @@ pipeline {
stage('Delete E2E Namespaces') { stage('Delete E2E Namespaces') {
when { when {
anyOf { expression { !SKIP_RUN }
triggeredBy 'BuildUpstreamCause'
triggeredBy cause: "UserIdCause"
}
} }
steps { steps {
script { script {
...@@ -701,7 +696,7 @@ Void sendFailureMessage() { ...@@ -701,7 +696,7 @@ Void sendFailureMessage() {
String getFailedStage() { String getFailedStage() {
if (FAILED_PARALLEL_STAGE.trim()) { if (FAILED_PARALLEL_STAGE.trim()) {
return FAILED_PARALLEL_STAGE return FAILED_PARALLEL_STAGE.trim()
} }
return FAILED_STAGE return FAILED_STAGE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment