2020-04-17 11:01:43 +02:00
|
|
|
import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
|
|
|
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
|
|
|
|
|
|
|
def call(JobConfiguration config) {
|
|
|
|
|
|
|
|
ContextRegistry.registerDefaultContext(this)
|
|
|
|
|
2020-04-17 13:31:30 +02:00
|
|
|
// TODO: Вынести в отдельный класс по аналогии с SonarScanner
|
|
|
|
|
2020-04-17 11:01:43 +02:00
|
|
|
printLocation()
|
|
|
|
|
2020-04-17 13:24:58 +02:00
|
|
|
if (!config.stageFlags.syntaxCheck) {
|
2020-04-17 11:01:43 +02:00
|
|
|
echo("Syntax-check step is disabled")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:24:58 +02:00
|
|
|
def options = config.syntaxCheckOptions
|
|
|
|
|
2020-04-17 11:01:43 +02:00
|
|
|
installLocalDependencies()
|
|
|
|
|
|
|
|
unzipInfobase()
|
|
|
|
|
2020-04-17 12:40:25 +02:00
|
|
|
def outPath = new File(options.pathToJUnitReport).getParent()
|
2020-04-27 17:05:45 +02:00
|
|
|
createDir(outPath)
|
2020-04-17 11:01:43 +02:00
|
|
|
|
|
|
|
String command = "oscript_modules/bin/vrunner syntax-check --ibconnection \"/F./build/ib\""
|
|
|
|
|
2020-04-17 13:45:44 +02:00
|
|
|
// Временно убрал передачу параметра.
|
|
|
|
// См. https://github.com/vanessa-opensource/vanessa-runner/issues/361
|
|
|
|
// command += " --workspace $env.WORKSPACE"
|
2020-04-17 12:22:15 +02:00
|
|
|
|
2020-04-17 11:01:43 +02:00
|
|
|
if (options.groupErrorsByMetadata) {
|
|
|
|
command += " --groupbymetadata"
|
|
|
|
}
|
|
|
|
|
|
|
|
command += " --junitpath " + options.pathToJUnitReport;
|
|
|
|
|
|
|
|
command += " --mode " + options.checkModes.join(" ")
|
|
|
|
|
|
|
|
// Запуск синтакс-проверки
|
|
|
|
cmd(command, true)
|
|
|
|
|
|
|
|
junit allowEmptyResults: true, testResults: options.pathToJUnitReport
|
|
|
|
|
2020-04-17 14:45:51 +02:00
|
|
|
archiveArtifacts options.pathToJUnitReport
|
2020-04-17 11:01:43 +02:00
|
|
|
}
|