Skip to content

Commit

Permalink
add archiveInfobase
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Dec 22, 2024
1 parent c8d5012 commit 9a3629f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions resources/globalConfiguration.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"additionalInitializationSteps": [],
"templateDBPath": "",
"vrunnerSettings": "./tools/vrunner.json",
"archiveInfobase": false,
"extensions": []
},
"bdd": {
Expand Down
4 changes: 4 additions & 0 deletions resources/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
"type" : "boolean",
"description" : "Запустить миграцию ИБ"
},
"archiveInfobase" : {
"type" : "boolean",
"description" : "\n Сохранить базу после выполнения всех шагов инициализации\n "
},
"templateDBPath" : {
"type" : "string",
"description" : "\n Путь к файлу эталонной базы данных.\n * По умолчанию не заполнен;\n * Указывается путь к файлу *.dt или *.1CD.\n "
Expand Down
1 change: 1 addition & 0 deletions src/idea.gdsl
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class InitInfoBaseOptions implements Serializable {
""")
String templateDBPath

@JsonPropertyDescription("""
Сохранить базу после выполнения всех шагов инициализации
""")
Boolean archiveInfobase

@JsonPropertyDescription("Массив расширений для загрузки в конфигурацию.")
Extension[] extensions

Expand Down Expand Up @@ -80,6 +85,7 @@ class InitInfoBaseOptions implements Serializable {
", vrunnerSettings=" + vrunnerSettings +
", templateDBPath=" + templateDBPath +
", additionalInitializationSteps=" + additionalInitializationSteps +
", archiveInfobase=" + archiveInfobase +
", extensions=" + extensions +
'}'
}
Expand Down
2 changes: 1 addition & 1 deletion vars/pipeline1C.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void call() {
timeout(time: config.timeoutOptions.zipInfoBase, unit: TimeUnit.MINUTES) {
printLocation()

zipInfobase()
zipInfobase(config)
}
}
}
Expand Down
18 changes: 13 additions & 5 deletions vars/zipInfobase.groovy
Original file line number Diff line number Diff line change
@@ -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
}

}

0 comments on commit 9a3629f

Please sign in to comment.