You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Merge pull request #37 from firstBitSemenovskaya/feature-vrunner-no-cache-use
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,3 +5,6 @@ bin/
|
||||
lib/
|
||||
|
||||
*.iml
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
|
@@ -34,7 +34,7 @@ class Bdd implements Serializable {
|
||||
config.bddOptions.vrunnerSteps.each {
|
||||
Logger.println("Шаг запуска сценариев командой ${it}")
|
||||
String vrunnerPath = VRunner.getVRunnerPath();
|
||||
steps.cmd("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
|
||||
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -44,6 +44,6 @@ class InitFromFiles implements Serializable {
|
||||
Logger.println("Выполнение загрузки конфигурации из файлов")
|
||||
String vrunnerPath = VRunner.getVRunnerPath();
|
||||
def initCommand = "$vrunnerPath init-dev --src $srcDir --ibconnection \"/F./build/ib\""
|
||||
steps.cmd(initCommand)
|
||||
VRunner.exec(initCommand)
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class InitFromStorage implements Serializable {
|
||||
)
|
||||
]) {
|
||||
String vrunnerPath = VRunner.getVRunnerPath()
|
||||
steps.cmd "$vrunnerPath init-dev --storage $storageVersionParameter --ibconnection \"/F./build/ib\""
|
||||
VRunner.exec "$vrunnerPath init-dev --storage $storageVersionParameter --ibconnection \"/F./build/ib\""
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,7 +37,7 @@ class InitInfobase implements Serializable {
|
||||
|
||||
// Запуск миграции
|
||||
steps.catchError {
|
||||
steps.cmd(vrunnerPath + ' run --command "ЗапуститьОбновлениеИнформационнойБазы;ЗавершитьРаботуСистемы;" --execute \\$runnerRoot/epf/ЗакрытьПредприятие.epf --ibconnection "/F./build/ib"')
|
||||
VRunner.exec(vrunnerPath + ' run --command "ЗапуститьОбновлениеИнформационнойБазы;ЗавершитьРаботуСистемы;" --execute \\$runnerRoot/epf/ЗакрытьПредприятие.epf --ibconnection "/F./build/ib"')
|
||||
}
|
||||
} else {
|
||||
Logger.println("Шаг миграции ИБ выключен")
|
||||
@@ -49,12 +49,12 @@ class InitInfobase implements Serializable {
|
||||
files = files.sort new OrderBy( { it.name })
|
||||
files.each {
|
||||
Logger.println("Первичная инициализация файлом ${it.path}")
|
||||
steps.cmd("$vrunnerPath vanessa --settings ${it.path} --ibconnection \"/F./build/ib\"")
|
||||
VRunner.exec("$vrunnerPath vanessa --settings ${it.path} --ibconnection \"/F./build/ib\"")
|
||||
}
|
||||
} else {
|
||||
config.initInfobaseOptions.additionalInitializationSteps.each {
|
||||
Logger.println("Первичная инициализация командой ${it}")
|
||||
steps.cmd("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
|
||||
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,8 @@ import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||
|
||||
class VRunner {
|
||||
|
||||
static final String DEFAULT_VRUNNER_OPTS = "RUNNER_NOCACHEUSE=1"
|
||||
|
||||
static String getVRunnerPath() {
|
||||
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
@@ -17,4 +19,12 @@ class VRunner {
|
||||
|
||||
return vrunnerPath;
|
||||
}
|
||||
|
||||
static int exec(String command, boolean returnStatus = false) {
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
|
||||
steps.withEnv([DEFAULT_VRUNNER_OPTS]) {
|
||||
return steps.cmd(command, returnStatus)
|
||||
} as int
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ def call(JobConfiguration config) {
|
||||
}
|
||||
|
||||
// Запуск синтакс-проверки
|
||||
cmd(command, true)
|
||||
VRunner.exec(command, true)
|
||||
|
||||
junit allowEmptyResults: true, testResults: FileUtils.getLocalPath(pathToJUnitReport)
|
||||
|
||||
|
Reference in New Issue
Block a user