ArrayList getChangedStatusOrFiles()

in src/com/epam/digital/data/platform/pipelines/registry/RegistryRegulations.groovy [58:85]


    ArrayList getChangedStatusOrFiles(String cliCommand, String cliParams, String cliOpt) {
        ArrayList regulationState = []
        boolean fullDeploy = context.getParameterValue("FULL_DEPLOY", "false").toBoolean()
        if (fullDeploy) {
            regulationState.add("fullDeploy")
            return regulationState
        }
        if (cliCommand == "plan") {
            try {
                regulationState = context.script.sh(script: "set +x; java -jar -DOPENSHIFT_NAMESPACE=${context.namespace} " +
                        "${REGISTRY_REGULATIONS_CLI_JAR} ${cliCommand} ${cliParams} ${cliOpt}",
                        returnStdout: true)
                        .split("PlanCommandExecutionStart")[1]
                        .split("PlanCommandExecutionEnd")[0]
                        .trim()
                        .tokenize(',')
            }
            catch (any) {
                context.script.error("Registry regulations cli failed during retrieving changes")
            }
            return regulationState
        } else {
            String regulationStateLog = context.script.sh(script: "set +x; java -jar -DOPENSHIFT_NAMESPACE=${context.namespace} " +
                    "${REGISTRY_REGULATIONS_CLI_JAR} ${cliCommand} ${cliParams} ${cliOpt}", returnStdout: true)
            return regulationStateLog
        }

    }