当前位置: 首页>>代码示例>>Java>>正文


Java ProgramCommandLine类代码示例

本文整理汇总了Java中jetbrains.buildServer.agent.runner.ProgramCommandLine的典型用法代码示例。如果您正苦于以下问题:Java ProgramCommandLine类的具体用法?Java ProgramCommandLine怎么用?Java ProgramCommandLine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProgramCommandLine类属于jetbrains.buildServer.agent.runner包,在下文中一共展示了ProgramCommandLine类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@NotNull
@Override
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
    BuildProgressLogger buildLogger = getLogger();
    BuildRunnerContext buildRunnerContext = getRunnerContext();
    Map<String, String> programEnvironmentVariables = buildRunnerContext.getBuildParameters().getEnvironmentVariables();
    String programWorkingDirectory = getProgramWorkingDirectory();
    String programPath = getProgramPath();
    List<String> programArgs = getProgramArgs();

    buildLogger.message("Program environment variables: " + programEnvironmentVariables.toString());
    buildLogger.message("Program working directory: " + programWorkingDirectory);
    buildLogger.message("Program path: " + programPath);
    buildLogger.message("Program args: " + programArgs.toString());

    return new SimpleProgramCommandLine(buildRunnerContext.getBuildParameters().getEnvironmentVariables(), programWorkingDirectory, programPath, programArgs);
}
 
开发者ID:stevenlauwers22,项目名称:DotNetBuild.TeamCity,代码行数:18,代码来源:DotNetBuildBuildService.java

示例2: makeExecutableCommand

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
private ProgramCommandLine makeExecutableCommand(AnsibleRunConfig config)
        throws RunBuildException {
    String workingDir = getWorkingDirectory().getPath();
    StringBuilder args = new StringBuilder("");
    if (!StringUtil.isEmptyOrSpaces(config.getInventory())) {
        args.append("-i ").append(config.getInventory());
    }
    if (StringUtil.isEmptyOrSpaces(config.getPlaybook())) {
        throw new RunBuildException("Ansible playbook should be specified");
    }
    args.append(" ").append(config.getPlaybook());
    if (!StringUtil.isEmptyOrSpaces(config.getOptions())) {
        args.append(" ").append(config.getOptions());
    }
    return new SimpleProgramCommandLine(getProvidedEnvironmetVariables(),
            workingDir,
           config.getExecutable(), CommandLineArgumentsUtil.extractArguments(args.toString()));
}
 
开发者ID:andreizhuk,项目名称:tc-ansible-runner,代码行数:19,代码来源:AnsibleRunService.java

示例3: makeCommandLineForScript

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
/**
 *  Returns commandLine when need to execute script.
 * @return commindLine with script
 * @throws RunBuildException if ssetting executable attribute for script be failed
 */
@NotNull
private ProgramCommandLine makeCommandLineForScript() throws RunBuildException {
  addMyEnviroventVariblies();
  final String script = getScript();
  enableExecution(script, getWorkingDirectory().getAbsolutePath());
  return createCommandLine(script, Collections.<String>emptyList());
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:13,代码来源:AutotoolsBuildCLBService.java

示例4: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@NotNull
@Override
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();
        }
    };
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:39,代码来源:HelmBuildService.java

示例5: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@NotNull
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
    return new ProgramCommandLine() {
        @NotNull
        public String getExecutablePath() throws RunBuildException {
            return _isOnWindows? "cmd" : "sh";
        }

        @NotNull
        public String getWorkingDirectory() throws RunBuildException {
            return getCheckoutDirectory().getPath();
        }

        @NotNull
        public List<String> getArguments() throws RunBuildException {
            List<String > ret = new Vector<String>();
            if(_isOnWindows)
            {
                ret.add("/c");
            }
            ret.add("echo");
            ret.add("Branch name is " + getConfigParameters().get(BranchNameParamName));
            return ret;
        }

        @NotNull
        public Map<String, String> getEnvironment() throws RunBuildException {
            return getBuildParameters().getEnvironmentVariables();
        }
    };
}
 
开发者ID:Nicologies,项目名称:PrExtras,代码行数:32,代码来源:BuildService.java

示例6: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@NotNull
@Override
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
    PropertyPlaceholderHelper.PlaceholderResolver resolver = new TeamcityPlaceholderResolver();
    int envVarsFromFile = injectPropertiesFromFile(resolver);
    int envVarsFromContent = injectPropertiesFromContent(resolver);
    if (envVarsFromContent == 0 && envVarsFromFile == 0) {
        getLogger().error("You have used the EnvInject plugin but not provided a properties file or content");
        getLogger().error("This runner will effectively be a no-op");
    }
    return new SimpleProgramCommandLine(getRunnerContext(), "java", Collections.singletonList("-version"));
}
 
开发者ID:kannanekanath,项目名称:teamcity-envinject-plugin,代码行数:13,代码来源:EnvInjectService.java

示例7: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@Override
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
    AnsibleRunConfig config = new AnsibleRunConfig(getRunnerParameters());
    if (LOG.isDebugEnabled()) {
        LOG.debug("Going to run ansible with parameters: " + config.toString());
    }
    if (AnsibleCommand.CUSTOM_SCRIPT.equals(config.getCommandType())) {
        return makeCustomScriptCommand(config);
    }
    return makeExecutableCommand(config);
}
 
开发者ID:andreizhuk,项目名称:tc-ansible-runner,代码行数:12,代码来源:AnsibleRunService.java

示例8: makeCustomScriptCommand

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
private ProgramCommandLine makeCustomScriptCommand(AnsibleRunConfig config) throws RunBuildException {
    String workingDir = getWorkingDirectory().getPath();
    List<String> args = Collections.emptyList();
    String customScript = getCustomScriptExecutable(config);
    return new SimpleProgramCommandLine(getProvidedEnvironmetVariables(),
            workingDir,
            customScript, args);
}
 
开发者ID:andreizhuk,项目名称:tc-ansible-runner,代码行数:9,代码来源:AnsibleRunService.java

示例9: makeProgramCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
@Override
@NotNull
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
  return makeCommandLineForScript();
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:6,代码来源:AutotoolsBuildCLBService.java

示例10: createCommandLine

import jetbrains.buildServer.agent.runner.ProgramCommandLine; //导入依赖的package包/类
/**
 * Creates command Line with content exePath and list of arguments.
 * @param exePath  path to execute
 * @param arguments arguments for execution
 * @return ProgramCommandLine
 */
@NotNull
private ProgramCommandLine createCommandLine(@NotNull final String exePath, @NotNull final List<String> arguments) {
  return new SimpleProgramCommandLine(getRunnerContext(), exePath, arguments);
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:11,代码来源:AutotoolsBuildCLBService.java


注:本文中的jetbrains.buildServer.agent.runner.ProgramCommandLine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。