in src/com/epam/digital/data/platform/pipelines/stages/impl/dataplatform/CreateRedashRoles.groovy [31:53]
void run() {
this.deploymentMode = context.getParameterValue("DEPLOYMENT_MODE", "development")
if (context.registryRegulations.deployStatus("create-redash-roles", "${RegulationType.ROLES.value}")) {
context.logger.info("Creating redash ${RegulationType.ROLES.value}")
if (deploymentMode.equals("development")) {
context.logger.info("Creating admin role on replica for redash admin instance")
createRoles("admin", context.redash.adminUrl, context.redash.adminApiKey)
context.logger.info("Admin role has been successfully created")
}
context.logger.info("Creating rest of roles on replica for redash viewer instance")
createRoles("roles", context.redash.viewerUrl, context.redash.viewerApiKey)
context.logger.info("Other roles have been successfully created")
context.logger.info("Redash ${RegulationType.ROLES.value} creation have been finished")
context.registryRegulations.getChangedStatusOrFiles("save", "create-redash-roles",
"--file ${context.getWorkDir()}/${RegulationType.ROLES.value}")
} else {
context.logger.info("Skip redash ${RegulationType.ROLES.value} creation due to no changes")
}
}