diff --git a/resources/globalConfiguration.json b/resources/globalConfiguration.json index 7e0e6e01..c25f3e7e 100644 --- a/resources/globalConfiguration.json +++ b/resources/globalConfiguration.json @@ -45,6 +45,7 @@ "additionalInitializationSteps": [], "templateDBPath": "", "vrunnerSettings": "./tools/vrunner.json", + "archiveInfobase": false, "extensions": [] }, "bdd": { diff --git a/resources/schema.json b/resources/schema.json index 5e03b5db..6f143f4b 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -119,6 +119,10 @@ "type" : "boolean", "description" : "Запустить миграцию ИБ" }, + "archiveInfobase" : { + "type" : "boolean", + "description" : "\n Сохранить базу после выполнения всех шагов инициализации\n " + }, "templateDBPath" : { "type" : "string", "description" : "\n Путь к файлу эталонной базы данных.\n * По умолчанию не заполнен;\n * Указывается путь к файлу *.dt или *.1CD.\n " diff --git a/src/idea.gdsl b/src/idea.gdsl index e51bac54..74d41233 100644 --- a/src/idea.gdsl +++ b/src/idea.gdsl @@ -406,6 +406,7 @@ contributor(closures) { method(name: 'initFromFiles', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Initialize infobase from source files') method(name: 'initFromStorage', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Initialize infobase from storage') method(name: 'initInfobase', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Initialize infobase - run migrations and preparation scripts') + method(name: 'zipInfobase', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: '') method(name: 'transform', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Transform results of tests') method(name: 'syntaxCheck', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Run syntax check') method(name: 'smoke', params: [config: 'ru.pulsar.jenkins.library.configuration.JobConfiguration'], doc: 'Run smoke tests') diff --git a/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy b/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy index 32f7ca9f..aaaa8ed4 100644 --- a/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy +++ b/src/ru/pulsar/jenkins/library/configuration/InitInfoBaseOptions.groovy @@ -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 + '}' } diff --git a/vars/pipeline1C.groovy b/vars/pipeline1C.groovy index 867e3830..e9e407d7 100644 --- a/vars/pipeline1C.groovy +++ b/vars/pipeline1C.groovy @@ -144,7 +144,7 @@ void call() { timeout(time: config.timeoutOptions.zipInfoBase, unit: TimeUnit.MINUTES) { printLocation() - zipInfobase() + zipInfobase(config) } } } diff --git a/vars/zipInfobase.groovy b/vars/zipInfobase.groovy index 14bc94ae..7b9626ad 100644 --- a/vars/zipInfobase.groovy +++ b/vars/zipInfobase.groovy @@ -1,7 +1,15 @@ -def call() { - if (fileExists('1Cv8.1CD.zip')) { - fileOperations([fileDeleteOperation(includes: '1Cv8.1CD.zip')]) +import ru.pulsar.jenkins.library.configuration.JobConfiguration + +def call(JobConfiguration config) { + + def archiveName = '1Cv8.1CD.zip' + if (fileExists(archiveName)) { + fileOperations([fileDeleteOperation(includes: archiveName)]) } - zip dir: 'build/ib', glob: '1Cv8.1CD', zipFile: '1Cv8.1CD.zip' - stash name: "1Cv8.1CD.zip", includes: "1Cv8.1CD.zip", allowEmpty: false + zip dir: 'build/ib', glob: '1Cv8.1CD', zipFile: archiveName + stash name: archiveName, includes: archiveName, allowEmpty: false + if (config.initInfoBaseOptions.archiveInfobase) { + archiveArtifacts archiveName + } + }