1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2025-08-25 20:09:25 +02:00

Значение настроек vrunnerSettings "По умолчанию" теперь равно ./tools/vrunner.json

В случае если база инициализирована из шаблона - настройки добавляются. Если нет - не добавляются. Это работает только на этапе, где настройки не обязательны.
This commit is contained in:
Egor Ivanov
2024-08-27 11:02:19 +03:00
parent 9c0ba58d5a
commit 50e73ea800
5 changed files with 25 additions and 19 deletions

View File

@@ -44,7 +44,7 @@
"runMigration": true,
"additionalInitializationSteps": [],
"templateDBPath": "",
"vrunnerSettings": "",
"vrunnerSettings": "./tools/vrunner.json",
"extensions": []
},
"bdd": {

View File

@@ -80,4 +80,8 @@ class InitInfoBaseOptions implements Serializable {
", extensions=" + extensions +
'}'
}
boolean templateDBLoaded() {
return templateDBPath != null && !templateDBPath.isEmpty()
}
}

View File

@@ -9,7 +9,7 @@ import ru.pulsar.jenkins.library.utils.VRunner
class InitFromFiles implements Serializable {
private final JobConfiguration config;
private final JobConfiguration config
InitFromFiles(JobConfiguration config) {
this.config = config
@@ -28,26 +28,26 @@ class InitFromFiles implements Serializable {
Logger.println("Распаковка файлов")
String srcDir;
String srcDir
if (config.sourceFormat == SourceFormat.EDT) {
def env = steps.env();
def env = steps.env()
srcDir = "$env.WORKSPACE/$EdtToDesignerFormatTransformation.CONFIGURATION_DIR"
steps.unstash(EdtToDesignerFormatTransformation.CONFIGURATION_ZIP_STASH)
steps.unzip(srcDir, EdtToDesignerFormatTransformation.CONFIGURATION_ZIP)
} else {
srcDir = config.srcDir;
srcDir = config.srcDir
}
Logger.println("Выполнение загрузки конфигурации из файлов")
String vrunnerPath = VRunner.getVRunnerPath();
String vrunnerPath = VRunner.getVRunnerPath()
def command = "$vrunnerPath update-dev --src $srcDir --ibconnection \"/F./build/ib\""
def options = config.initInfoBaseOptions
String vrunnerSettings = options.vrunnerSettings
if (vrunnerSettings != '' && steps.fileExists(vrunnerSettings)) {
if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) {
command += " --settings $vrunnerSettings"
}

View File

@@ -60,7 +60,7 @@ class InitFromStorage implements Serializable {
def options = config.initInfoBaseOptions
String vrunnerSettings = options.vrunnerSettings
if (vrunnerSettings != '' && steps.fileExists(vrunnerSettings)) {
if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) {
command += " --settings $vrunnerSettings"
}

View File

@@ -9,7 +9,7 @@ import ru.pulsar.jenkins.library.utils.VRunner
class InitInfoBase implements Serializable {
private final JobConfiguration config;
private final JobConfiguration config
InitInfoBase(JobConfiguration config) {
this.config = config
@@ -30,7 +30,15 @@ class InitInfoBase implements Serializable {
List<String> logosConfig = ["LOGOS_CONFIG=$config.logosConfig"]
steps.withEnv(logosConfig) {
String vrunnerPath = VRunner.getVRunnerPath();
String vrunnerPath = VRunner.getVRunnerPath()
// Нужны ли настройки vrunner
def options = config.initInfoBaseOptions
String settingsIncrement = ''
String vrunnerSettings = options.vrunnerSettings
if (options.templateDBLoaded() && steps.fileExists(vrunnerSettings)) {
settingsIncrement = " --settings $vrunnerSettings"
}
if (config.initInfoBaseOptions.runMigration) {
Logger.println("Запуск миграции ИБ")
@@ -40,16 +48,10 @@ class InitInfoBase implements Serializable {
if (steps.isUnix()) {
executeParameter = '\\' + executeParameter
}
command += executeParameter;
command += executeParameter
command += ' --ibconnection "/F./build/ib"'
def options = config.initInfoBaseOptions
String vrunnerSettings = options.vrunnerSettings
if (vrunnerSettings != '' && steps.fileExists(vrunnerSettings)) {
command += " --settings $vrunnerSettings"
}
command += settingsIncrement
// Запуск миграции
steps.catchError {
VRunner.exec(command)
@@ -69,7 +71,7 @@ class InitInfoBase implements Serializable {
} else {
config.initInfoBaseOptions.additionalInitializationSteps.each {
Logger.println("Первичная инициализация командой ${it}")
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"")
VRunner.exec("$vrunnerPath ${it} --ibconnection \"/F./build/ib\"${settingsIncrement}")
}
}
}