void init()

in src/com/epam/digital/data/platform/pipelines/codebase/Codebase.groovy [71:97]


    void init() {
        this.name = context.getParameterValue("CODEBASE_NAME", "registry")
        this.codebaseJson = context.platform.getAsJson("codebase", this.name)["spec"]
        this.defaultBranch = this.codebaseJson["defaultBranch"]
        this.branch = context.getParameterValue("CODEBASE_BRANCH", this.defaultBranch).toLowerCase()
        this.repositoryPath = context.getParameterValue("REPOSITORY_PATH")
        this.jobProvisioner = this.codebaseJson["jobProvisioning"]
        if (codebaseJson["repository"]) {
            this.sourceRepository = this.codebaseJson["repository"]["url"]
        }
        if (context.getParameterValue("CODEBASE_HISTORY_NAME")) {
            this.historyName = context.getParameterValue("CODEBASE_HISTORY_NAME", "history-excerptor")
            this.codebaseHistoryJson = context.platform.getAsJson("codebase", this.historyName)["spec"]
            this.sourceHistoryRepository = this.codebaseHistoryJson["repository"]["url"]
        }
        this.type = this.codebaseJson["type"].toLowerCase()
        if (type == ProjectType.APPLICATION.getValue()) {
            this.imageName = "${name}-${branch}"
            this.imageTag = "latest"
            this.imageUrl = "${context.dockerRegistry.host}/${context.namespace}/${imageName}:${imageTag}"
            this.buildConfigName = imageName.replaceAll('\\.', "-")
        }
        this.jenkinsAgent = this.codebaseJson["jenkinsSlave"]
        this.buildToolSpec = this.codebaseJson["buildTool"]
        this.buildTool = BuildToolFactory.getBuildToolImpl(buildToolSpec, context)
        this.version = this.codebaseJson["versioning"]["startFrom"]
    }