You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-08-25 20:09:25 +02:00
Вынос templateDBLoaded на уровень конфигурации
This commit is contained in:
@@ -81,8 +81,4 @@ class InitInfoBaseOptions implements Serializable {
|
||||
", extensions=" + extensions +
|
||||
'}'
|
||||
}
|
||||
|
||||
boolean templateDBLoaded() {
|
||||
return templateDBPath != null && !templateDBPath.isEmpty()
|
||||
}
|
||||
}
|
||||
|
@@ -115,6 +115,10 @@ class JobConfiguration implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
boolean templateDBLoaded() {
|
||||
return initInfoBaseOptions.templateDBPath != null && !initInfoBaseOptions.templateDBPath.isEmpty()
|
||||
}
|
||||
|
||||
String v8AgentLabel() {
|
||||
return v8version
|
||||
}
|
||||
|
@@ -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"
|
||||
}
|
||||
|
||||
|
@@ -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"
|
||||
}
|
||||
|
||||
|
@@ -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}")
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user