in src/com/epam/digital/data/platform/pipelines/stages/impl/upgrade/CreateRegistrySettingsFile.groovy [30:50]
void run() {
context.script.sh("mkdir -p ${RegulationType.REGISTRY_SETTINGS.value}")
context.script.dir(RegulationType.REGISTRY_SETTINGS.value) {
if (context.script.fileExists(context.registry.REGISTRY_SETTINGS_FILE)) {
context.logger.info("Settings file already exists")
} else {
context.logger.info("Creating settings file")
String template = context.script.libraryResource("templates/other/settings.yml")
context.script.writeFile(file: context.registry.REGISTRY_SETTINGS_FILE, text: template)
context.script.sshagent(["${context.gitServer.credentialsId}"]) {
context.script.sh "git checkout -b ${context.codebase.branch}"
context.gitClient.gitSetConfig()
context.gitClient.gitAdd()
context.gitClient.gitCommit(COMMIT_MESSAGE)
context.script.retry(5) {
context.gitClient.gitPush(context.codebase.branch)
}
}
}
}
}