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