in src/com/epam/digital/data/platform/pipelines/stages/impl/dataplatform/GenerateProjects.groovy [31:75]
void run() {
String modules = ""
context.dataComponents.values().each {
modules += "--module=${it.name} "
}
context.logger.info("Generating data services")
context.script.sh(script: "cp ${context.registry.SETTINGS_FILE} ${SVC_GEN_UTIL_DIR}")
context.script.dir(context.getGeneratedProjectsDir()) {
context.script.sh(script: "set +x; java -jar " +
"-DPOSTGRES_PASSWORD=\'${context.postgres.operational_pg_password}\' " +
"-DPOSTGRES_USER=${context.postgres.operational_pg_user} " +
"-DDB_NAME=${context.registry.name} " +
"-DDB_URL=${context.postgres.OPERATIONAL_MASTER_URL} " +
"-DDB_PORT=${context.postgres.OPERATIONAL_MASTER_PORT} " +
"-Dsettings=${context.getWorkDir()}/${context.registry.SETTINGS_FILE} " +
"-DPLATFORM_VALUES_PATH=${context.registryRegulations.getRegistryConfValues()} " +
"${SVC_GEN_UTIL_DIR}/service-generation-utility.jar " +
"${modules} " +
"${context.logLevel == "DEBUG" ? "1>&2" : ""}")
}
context.dataComponents.values().each { dataComponent ->
context.script.dir(dataComponent.getWorkDir()) {
context.script.sh(script: "rm -rf ${dataComponent.DEPLOY_TEMPLATES_PATH}; " +
"cp -r ${context.getGeneratedProjectsDir()}/${dataComponent.name}/* .")
def pom = context.script.readMavenPom(file: "pom.xml")
String version = dataComponent.version
pom.version = version
context.script.writeMavenPom(model: pom)
if (dataComponent.name != DataComponentType.MODEL.getValue()) {
String chartYamlPath = "${dataComponent.DEPLOY_TEMPLATES_PATH}/Chart.yaml"
LinkedHashMap chartYaml = context.script.readYaml file: chartYamlPath
chartYaml.appVersion = dataComponent.version
chartYaml.version = dataComponent.version
context.script.writeYaml file: chartYamlPath, data: chartYaml, overwrite: true
DataComponent dataModel = context.dataComponents.get(DataComponentType.MODEL.getValue())
def pomXml = context.script.readMavenPom(file: "pom.xml")
pomXml.dependencies[1].version = dataModel.version
context.script.writeMavenPom(model: pomXml)
}
}
}
}