public ProgramCommandLine makeProgramCommandLine()

in teamcity-helm-plugin-agent/src/main/java/jetbrains/buildServer/helm/HelmBuildService.java [25:60]


    public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
        return new ProgramCommandLine() {
            @NotNull
            @Override
            public String getExecutablePath() throws RunBuildException {
                return getConfigParameters().get(HELM_PATH_CONFIG_PARAM);
            }

            @NotNull
            @Override
            public String getWorkingDirectory() throws RunBuildException {
                return getRunnerContext().getBuild().getCheckoutDirectory().getAbsolutePath();
            }

            @NotNull
            @Override
            public List<String> getArguments() throws RunBuildException {
                Map<String, String> runnerParameters = getRunnerParameters();
                String commandId = runnerParameters.get(HelmConstants.COMMAND_ID);
                if(commandId == null){
                    throw new RunBuildException(HelmConstants.COMMAND_ID + " parameter value is null");
                }
                HelmCommandArgumentsProvider argumentsProvider = myArgumentsProviders.find(commandId);
                if (argumentsProvider == null) {
                    throw new RunBuildException("Can't find argumentsProvider for command with id " + commandId);
                }
                return argumentsProvider.getArguments(runnerParameters);
            }

            @NotNull
            @Override
            public Map<String, String> getEnvironment() throws RunBuildException {
                return getRunnerContext().getBuildParameters().getEnvironmentVariables();
            }
        };
    }