diff --git a/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy b/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy index 7f99f6df..3ad72b92 100644 --- a/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy @@ -81,8 +81,4 @@ class InitInfoBaseOptions implements Serializable { ", extensions=" + extensions + '}' } - - boolean templateDBLoaded() { - return templateDBPath != null && !templateDBPath.isEmpty() - } } diff --git a/src/ru/pulsar/jenkins/library/configuration/JobConfiguration.groovy b/src/ru/pulsar/jenkins/library/configuration/JobConfiguration.groovy index 080bc23a..8330abe6 100644 --- a/src/ru/pulsar/jenkins/library/configuration/JobConfiguration.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/JobConfiguration.groovy @@ -115,6 +115,10 @@ class JobConfiguration implements Serializable { } } + boolean templateDBLoaded() { + return initInfoBaseOptions.templateDBPath != null && !initInfoBaseOptions.templateDBPath.isEmpty() + } + String v8AgentLabel() { return v8version } diff --git a/src/ru/pulsar/jenkins/library/steps/InitFromFiles.groovy b/src/ru/pulsar/jenkins/library/steps/InitFromFiles.groovy index 0d8b8c58..47445ce3 100644 --- a/src/ru/pulsar/jenkins/library/steps/InitFromFiles.groovy +++ b/src/ru/pulsar/jenkins/library/steps/InitFromFiles.groovy @@ -47,7 +47,7 @@ class InitFromFiles implements Serializable { def options = config.initInfoBaseOptions String vrunnerSettings = options.vrunnerSettings - if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { + if (config.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { command += " --settings $vrunnerSettings" } diff --git a/src/ru/pulsar/jenkins/library/steps/InitFromStorage.groovy b/src/ru/pulsar/jenkins/library/steps/InitFromStorage.groovy index f944c5a9..79b805db 100644 --- a/src/ru/pulsar/jenkins/library/steps/InitFromStorage.groovy +++ b/src/ru/pulsar/jenkins/library/steps/InitFromStorage.groovy @@ -60,7 +60,7 @@ class InitFromStorage implements Serializable { def options = config.initInfoBaseOptions String vrunnerSettings = options.vrunnerSettings - if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { + if (config.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { command += " --settings $vrunnerSettings" } diff --git a/src/ru/pulsar/jenkins/library/steps/InitInfoBase.groovy b/src/ru/pulsar/jenkins/library/steps/InitInfoBase.groovy index 92457dca..d3cedc6b 100644 --- a/src/ru/pulsar/jenkins/library/steps/InitInfoBase.groovy +++ b/src/ru/pulsar/jenkins/library/steps/InitInfoBase.groovy @@ -36,11 +36,11 @@ class InitInfoBase implements Serializable { def options = config.initInfoBaseOptions String settingsIncrement = '' String vrunnerSettings = options.vrunnerSettings - if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { + if (config.templateDBLoaded() && steps.fileExists(vrunnerSettings)) { settingsIncrement = " --settings $vrunnerSettings" } - if (config.initInfoBaseOptions.runMigration) { + if (options.runMigration) { Logger.println("Запуск миграции ИБ") String command = vrunnerPath + ' run --command "ЗапуститьОбновлениеИнформационнойБазы;ЗавершитьРаботуСистемы;" --execute ' @@ -61,7 +61,7 @@ class InitInfoBase implements Serializable { } steps.catchError { - if (config.initInfoBaseOptions.additionalInitializationSteps.length == 0) { + if (options.additionalInitializationSteps.length == 0) { FileWrapper[] files = steps.findFiles("tools/vrunner.init*.json") files = files.sort new OrderBy( { it.name }) files.each { @@ -69,7 +69,7 @@ class InitInfoBase implements Serializable { VRunner.exec("$vrunnerPath vanessa --settings ${it.path} --ibconnection \"/F./build/ib\"") } } else { - config.initInfoBaseOptions.additionalInitializationSteps.each { + options.additionalInitializationSteps.each { Logger.println("Первичная инициализация командой ${it}") VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"${settingsIncrement}") } diff --git a/src/ru/pulsar/jenkins/library/steps/LoadExtensions.groovy b/src/ru/pulsar/jenkins/library/steps/LoadExtensions.groovy index 9caf9296..da3e2169 100644 --- a/src/ru/pulsar/jenkins/library/steps/LoadExtensions.groovy +++ b/src/ru/pulsar/jenkins/library/steps/LoadExtensions.groovy @@ -91,10 +91,10 @@ class LoadExtensions implements Serializable { } // For InitInfoBaseOptions, return the vrunner settings path only if the database is loaded from an archive - if (optionsInstance instanceof InitInfoBaseOptions && !optionsInstance.templateDBLoaded()) { + if (optionsInstance instanceof InitInfoBaseOptions && !config.templateDBLoaded()) { return "" } - return optionsInstance."vrunnerSettings" + return optionsInstance.vrunnerSettings } }