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

add archiveInfobase

This commit is contained in:
Dima
2024-12-22 14:38:22 +03:00
parent 4c73fcd494
commit 5660e0c4bf
7 changed files with 28 additions and 7 deletions

View File

@@ -45,6 +45,7 @@
"additionalInitializationSteps": [],
"templateDBPath": "",
"vrunnerSettings": "./tools/vrunner.json",
"archiveInfobase": false,
"extensions": []
},
"bdd": {

View File

@@ -119,6 +119,10 @@
"type" : "boolean",
"description" : "Запустить миграцию ИБ"
},
"archiveInfobase" : {
"type" : "boolean",
"description" : "\n Сохранить базу после выполнения всех шагов инициализации\n "
},
"templateDBPath" : {
"type" : "string",
"description" : "\n Путь к файлу эталонной базы данных.\n * По умолчанию не заполнен;\n * Указывается путь к файлу *.dt или *.1CD.\n "

View File

@@ -89,6 +89,8 @@ interface IStepExecutor {
@SuppressWarnings('unused')
def zip(String dir, String zipFile, String glob)
def zip(String dir, String zipFile, String glob, boolean archive)
def unzip(String dir, String zipFile)
@SuppressWarnings('unused')

View File

@@ -196,6 +196,11 @@ class StepExecutor implements IStepExecutor {
steps.zip dir: dir, zipFile: zipFile, glob: glob, overwrite: true
}
@Override
def zip(String dir, String zipFile, String glob = '', boolean archive) {
steps.zip dir: dir, zipFile: zipFile, glob: glob, overwrite: true, archive: archive
}
@Override
def unzip(String dir, String zipFile, quiet = true) {
steps.unzip dir: dir, zipFile: zipFile, quiet: quiet

View File

@@ -40,6 +40,11 @@ class InitInfoBaseOptions implements Serializable {
""")
String templateDBPath
@JsonPropertyDescription("""
Сохранить базу после выполнения всех шагов инициализации
""")
Boolean archiveInfobase
@JsonPropertyDescription("Массив расширений для загрузки в конфигурацию.")
Extension[] extensions
@@ -80,6 +85,7 @@ class InitInfoBaseOptions implements Serializable {
", vrunnerSettings=" + vrunnerSettings +
", templateDBPath=" + templateDBPath +
", additionalInitializationSteps=" + additionalInitializationSteps +
", archiveInfobase=" + archiveInfobase +
", extensions=" + extensions +
'}'
}

View File

@@ -144,7 +144,7 @@ void call() {
timeout(time: config.timeoutOptions.zipInfoBase, unit: TimeUnit.MINUTES) {
printLocation()
zipInfobase()
zipInfobase(config)
}
}
}

View File

@@ -1,7 +1,10 @@
def call() {
if (fileExists('1Cv8.1CD.zip')) {
fileOperations([fileDeleteOperation(includes: '1Cv8.1CD.zip')])
}
zip dir: 'build/ib', glob: '1Cv8.1CD', zipFile: '1Cv8.1CD.zip'
stash name: "1Cv8.1CD.zip", includes: "1Cv8.1CD.zip", allowEmpty: false
import ru.pulsar.jenkins.library.configuration.JobConfiguration
def call(JobConfiguration config) {
def archiveName = '1Cv8.1CD.zip'
zip dir: 'build/ib', glob: '1Cv8.1CD', zipFile: archiveName, archive: config.initInfoBaseOptions.archiveInfobase
stash name: archiveName, includes: archiveName, allowEmpty: false
}