-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Загрузка базы-эталона из DT или 1CD #124
Merged
nixel2007
merged 22 commits into
firstBitMarksistskaya:develop
from
Segate-ekb:feature/dt_load
Aug 30, 2024
Merged
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
60e184c
Имплементация загрузки из dt или 1cd
Segate-ekb 3f12889
Описал Readme, Добавил vrunner settings во все места
Segate-ekb 4108f98
Добавил имя стейджа в pipeline1C.groovy
Segate-ekb 632fc87
fix у initInfobase опции не в lowercase
Segate-ekb eefbb89
Добавил степ createInfobase.groovy, убрал дублирование установки зави…
Segate-ekb b503ae6
Убрал лишнее обновление. После загрузки оно не нужно.
Segate-ekb d43d6bd
Выделил стейдж создания базы.
Segate-ekb 5abf419
Update vars/pipeline1C.groovy
Segate-ekb 6b90045
Update src/ru/pulsar/jenkins/library/configuration/TimeoutOptions.groovy
Segate-ekb 55ff0d2
Заменил baseDBpath на templateDBPath
Segate-ekb 9f07d3e
gradlew 7.6.1
nixel2007 be50b03
deps bump
nixel2007 5fb93d2
Additionally check toUri
nixel2007 258af0e
loadSources -> loadConfiguration
nixel2007 9c0ba58
JDK 17 on CI
nixel2007 50e73ea
Значение настроек vrunnerSettings "По умолчанию" теперь равно ./tools…
Segate-ekb f158b48
Фикс ошибки с загрузкой расширения
Segate-ekb a9fbf86
Исправил описание в схеме
Segate-ekb 5c5b284
Небольшой рефакторинг
nixel2007 a656789
Вынос templateDBLoaded на уровень конфигурации
nixel2007 63b2800
Небольшие правки документации
nixel2007 7f9bf6b
Исправлена ошибка компиляции
nixel2007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package ru.pulsar.jenkins.library.steps | ||
Segate-ekb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import ru.pulsar.jenkins.library.IStepExecutor | ||
import ru.pulsar.jenkins.library.configuration.JobConfiguration | ||
import ru.pulsar.jenkins.library.ioc.ContextRegistry | ||
import ru.pulsar.jenkins.library.utils.Logger | ||
import ru.pulsar.jenkins.library.utils.VRunner | ||
import hudson.FilePath | ||
import ru.pulsar.jenkins.library.utils.FileUtils | ||
|
||
class CreateInfobase implements Serializable { | ||
|
||
private final JobConfiguration config; | ||
|
||
CreateInfobase(JobConfiguration config) { | ||
this.config = config | ||
} | ||
|
||
def run() { | ||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor() | ||
|
||
Logger.printLocation() | ||
|
||
def env = steps.env() | ||
|
||
steps.installLocalDependencies(); | ||
nixel2007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
String baseDBPath = config.initInfoBaseOptions.baseDBPath | ||
if (baseDBPath == '') { | ||
// Не указан путь к базе данных, создадим пустую базу данных. | ||
createBase() | ||
} else if (baseDBPath.endsWith('.1CD')) { | ||
// Это файл базы данных 1С, просто скопируем его. | ||
String pathToInfobase = "$env.WORKSPACE/build/ib/1Cv8.1CD" | ||
FileUtils.loadFile(baseDBPath, env, pathToInfobase) | ||
} else if (baseDBPath.endsWith('.dt')) { | ||
// Это файл дампа БД, скопируем его и создадим БД. | ||
String pathToDt = "$env.WORKSPACE/build/tmp/dump.dt" | ||
FileUtils.loadFile(baseDBPath, env, pathToDt) | ||
createBase('build/tmp/dump.dt') | ||
} else { | ||
Logger.println("Неизвестный формат базы данных. Поддерживаются только .1CD и .dt") | ||
} | ||
|
||
} | ||
|
||
private void createBase(String dtPath = '') { | ||
Logger.println("Создание информационной базы") | ||
String vrunnerPath = VRunner.getVRunnerPath(); | ||
def initCommand = "$vrunnerPath init-dev --ibconnection \"/F./build/ib\"" | ||
VRunner.exec(initCommand) | ||
|
||
if (dtPath) { | ||
// Загрузка из dt в vrunner 2.2.2 не работает корректно, потому инициировать через init-dev не получится. | ||
def loadDtCommand = "$vrunnerPath restore --ibconnection \"/F./build/ib\" $dtPath" | ||
VRunner.exec(loadDtCommand) | ||
} | ||
nixel2007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import ru.pulsar.jenkins.library.configuration.JobConfiguration | ||
import ru.pulsar.jenkins.library.ioc.ContextRegistry | ||
import ru.pulsar.jenkins.library.steps.CreateInfobase | ||
|
||
def call(JobConfiguration config) { | ||
ContextRegistry.registerDefaultContext(this) | ||
|
||
def createInfobase = new CreateInfobase(config) | ||
createInfobase.run() | ||
} | ||
nixel2007 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
так как это дефолт, то вполне можно добавить и в основной раздел.