Skip to content

Commit

Permalink
Merge pull request #37 from firstBitSemenovskaya/feature-vrunner-no-c…
Browse files Browse the repository at this point in the history
…ache-use
  • Loading branch information
nixel2007 authored Nov 8, 2021
2 parents b91748b + df5e4b7 commit 390123a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ bin/
lib/

*.iml
.classpath
.project
.settings/
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/Bdd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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\"")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/InitFromFiles.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/steps/InitFromStorage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/ru/pulsar/jenkins/library/steps/InitInfobase.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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("Шаг миграции ИБ выключен")
Expand All @@ -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\"")
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/ru/pulsar/jenkins/library/utils/VRunner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
}
2 changes: 1 addition & 1 deletion vars/syntaxCheck.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def call(JobConfiguration config) {
}

// Запуск синтакс-проверки
cmd(command, true)
VRunner.exec(command, true)

junit allowEmptyResults: true, testResults: FileUtils.getLocalPath(pathToJUnitReport)

Expand Down

0 comments on commit 390123a

Please sign in to comment.