Class SimpleProgramCommandLine
- java.lang.Object
-
- jetbrains.buildServer.agent.runner.SimpleProgramCommandLine
-
- All Implemented Interfaces:
ProgramCommandLine
public class SimpleProgramCommandLine extends java.lang.Object implements ProgramCommandLine
Base implementation forProgramCommandLine
- sets default working directory for process from
BuildRunnerContext.getWorkingDirectory()
- sets default build process environment from build parameters
BuildRunnerContext.getBuildParameters()
=>BuildParametersMap.getEnvironmentVariables()
-
-
Constructor Summary
Constructors Constructor Description SimpleProgramCommandLine(java.util.Map<java.lang.String,java.lang.String> env, java.lang.String workingDir, java.lang.String executablePath, java.util.List<java.lang.String> arguments)
SimpleProgramCommandLine(java.util.Map<java.lang.String,java.lang.String> env, java.lang.String workingDir, java.lang.String executablePath, java.util.List<java.lang.String> arguments, java.lang.String argumentsLine)
SimpleProgramCommandLine(AgentRunningBuild build, java.lang.String executablePath, java.util.List<java.lang.String> arguments)
SimpleProgramCommandLine(BuildRunnerContext runner, java.lang.String executablePath, java.util.List<java.lang.String> arguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getArguments()
All quotations are done property inside Java Runtimejava.lang.String
getCommandLineForLogging(PasswordReplacer passwordReplacer)
java.util.Map<java.lang.String,java.lang.String>
getEnvironment()
java.lang.String
getExecutablePath()
Returns either full pathrelative path to working dirsimply command name to be resolved by OS on the build agent to runjava.lang.String
getWorkingDirectory()
-
-
-
Constructor Detail
-
SimpleProgramCommandLine
@Deprecated public SimpleProgramCommandLine(@NotNull AgentRunningBuild build, @NotNull java.lang.String executablePath, @NotNull java.util.List<java.lang.String> arguments)
- Parameters:
build
- buildexecutablePath
- executable patharguments
- command arguments
-
SimpleProgramCommandLine
public SimpleProgramCommandLine(@NotNull BuildRunnerContext runner, @NotNull java.lang.String executablePath, @NotNull java.util.List<java.lang.String> arguments)
-
SimpleProgramCommandLine
public SimpleProgramCommandLine(@NotNull java.util.Map<java.lang.String,java.lang.String> env, @NotNull java.lang.String workingDir, @NotNull java.lang.String executablePath, @NotNull java.util.List<java.lang.String> arguments)
-
SimpleProgramCommandLine
public SimpleProgramCommandLine(@NotNull java.util.Map<java.lang.String,java.lang.String> env, @NotNull java.lang.String workingDir, @NotNull java.lang.String executablePath, @NotNull java.util.List<java.lang.String> arguments, @NotNull java.lang.String argumentsLine)
- Parameters:
env
- environment variablesworkingDir
- working directory of the running buildexecutablePath
- command line executable patharguments
- list of escaped arguments which will be passed into the processargumentsLine
- arguments string as these arguments are configured in build step. Used for logging, seegetCommandLineForLogging(jetbrains.buildServer.util.PasswordReplacer)
- Since:
- 2022.10
-
-
Method Detail
-
getExecutablePath
@NotNull public java.lang.String getExecutablePath() throws RunBuildException
Description copied from interface:ProgramCommandLine
Returns either- full path
- relative path to working dir
- simply command name to be resolved by OS on the build agent
- Specified by:
getExecutablePath
in interfaceProgramCommandLine
- Returns:
- file path to execute
- Throws:
RunBuildException
- on error in parameters or agent's machine environment
-
getWorkingDirectory
@NotNull public java.lang.String getWorkingDirectory()
- Specified by:
getWorkingDirectory
in interfaceProgramCommandLine
- Returns:
- executable working directory either relative on build checkout directory or absolute path
-
getArguments
@NotNull public java.util.List<java.lang.String> getArguments() throws RunBuildException
Description copied from interface:ProgramCommandLine
All quotations are done property inside Java Runtime- Specified by:
getArguments
in interfaceProgramCommandLine
- Returns:
- arguments to be sent to process
- Throws:
RunBuildException
- on error in parameters or agent's machine environment
-
getCommandLineForLogging
public java.lang.String getCommandLineForLogging(PasswordReplacer passwordReplacer) throws RunBuildException
- Specified by:
getCommandLineForLogging
in interfaceProgramCommandLine
- Returns:
- command line for logging, i.e. this line will be logged into build and agent logs. So the plugin should replace all passwords in this command line using provided password replacer.
- Throws:
RunBuildException
-
getEnvironment
@NotNull public java.util.Map<java.lang.String,java.lang.String> getEnvironment()
- Specified by:
getEnvironment
in interfaceProgramCommandLine
- Returns:
- map of all environment variables to be set for process
-
-