1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2025-08-25 20:09:25 +02:00

Условное выполнение stages

This commit is contained in:
Nikita Gryzlov
2020-04-29 13:52:07 +03:00
parent 7c1ef7c2cc
commit 9a8b0a182d
2 changed files with 32 additions and 0 deletions

View File

@@ -28,4 +28,8 @@ class StageFlags implements Serializable {
", smoke=" + smoke +
'}';
}
boolean needInfobase() {
return smoke || syntaxCheck
}
}

View File

@@ -41,6 +41,10 @@ void call() {
agent {
label agent1C
}
when {
beforeAgent true
expression { config.stageFlags.needInfobase() }
}
steps {
printLocation()
@@ -60,6 +64,10 @@ void call() {
agent {
label 'edt'
}
when {
beforeAgent true
expression { config.stageFlags.edtValidate }
}
steps {
edtTransform config
}
@@ -73,6 +81,10 @@ void call() {
agent {
label 'edt'
}
when {
beforeAgent true
expression { config.stageFlags.edtValidate }
}
steps {
edtValidate config
}
@@ -82,6 +94,10 @@ void call() {
agent {
label agent1C
}
when {
beforeAgent true
expression { config.stageFlags.syntaxCheck }
}
steps {
syntaxCheck config
}
@@ -91,6 +107,10 @@ void call() {
agent {
label agent1C
}
when {
beforeAgent true
expression { config.stageFlags.smoke }
}
steps {
smoke config
}
@@ -102,6 +122,10 @@ void call() {
agent {
label 'oscript'
}
when {
beforeAgent true
expression { config.stageFlags.edtValidate }
}
steps {
transform config
}
@@ -111,6 +135,10 @@ void call() {
agent {
label 'sonar'
}
when {
beforeAgent true
expression { config.stageFlags.sonarqube }
}
steps {
sonarScanner config
}