1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2024-11-28 09:33:03 +02:00

Спрятал дымовые за флагом

This commit is contained in:
Nikita Gryzlov 2020-04-28 11:50:37 +03:00
parent 308e5e40f9
commit fd4aeb4eef
No known key found for this signature in database
GPG Key ID: C1EAE411FEF0BF2F
5 changed files with 34 additions and 6 deletions

View File

@ -7,7 +7,8 @@
"stages": {
"sonarqube": false,
"syntaxCheck": false,
"edtValidate": false
"edtValidate": false,
"smoke": false
},
"sonarqube": {
"sonarQubeInstallation": "",

View File

@ -37,6 +37,10 @@
"edtValidate" : {
"type" : "boolean",
"description" : "Валидация EDT включена"
},
"smoke" : {
"type" : "boolean",
"description" : "Дымовые тесты включены"
}
}
},

View File

@ -15,6 +15,9 @@ class StageFlags implements Serializable {
@JsonPropertyDescription("Валидация EDT включена")
boolean edtValidate
@JsonPropertyDescription("Дымовые тесты включены")
boolean smoke
@Override
@NonCPS
String toString() {
@ -22,6 +25,7 @@ class StageFlags implements Serializable {
"sonarqube=" + sonarqube +
", syntaxCheck=" + syntaxCheck +
", edtValidate=" + edtValidate +
", smoke=" + smoke +
'}';
}
}

View File

@ -84,11 +84,7 @@ void call() {
stage('Дымовые тесты') {
steps {
printLocation()
installLocalDependencies()
unzipInfobase()
smoke config
}
}
}

23
vars/smoke.groovy Normal file
View File

@ -0,0 +1,23 @@
import ru.pulsar.jenkins.library.configuration.JobConfiguration
import ru.pulsar.jenkins.library.ioc.ContextRegistry
def call(JobConfiguration config) {
ContextRegistry.registerDefaultContext(this)
// TODO: Вынести в отдельный класс по аналогии с SonarScanner
printLocation()
if (!config.stageFlags.smoke) {
echo("Smoke tests step is disabled")
return
}
def options = config.syntaxCheckOptions
installLocalDependencies()
unzipInfobase()
}