本文整理汇总了Java中jetbrains.buildServer.agent.BuildRunnerContext类的典型用法代码示例。如果您正苦于以下问题:Java BuildRunnerContext类的具体用法?Java BuildRunnerContext怎么用?Java BuildRunnerContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BuildRunnerContext类属于jetbrains.buildServer.agent包,在下文中一共展示了BuildRunnerContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SMBBuildProcessAdapter
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public SMBBuildProcessAdapter(@NotNull final BuildRunnerContext context,
@NotNull final String username,
@NotNull final String password,
@Nullable final String domain,
@NotNull final String target,
@NotNull final List<ArtifactsCollection> artifactsCollections,
final boolean dnsOnlyNameResolution) {
super(context.getBuild().getBuildLogger());
myTarget = target;
myUsername = username;
myPassword = password;
myDomain = domain;
myArtifactsCollections = artifactsCollections;
jcifs.Config.setProperty("jcifs.smb.client.disablePlainTextPasswords", "false");
if (dnsOnlyNameResolution) {
jcifs.Config.setProperty("jcifs.resolveOrder", "DNS");
jcifs.Config.setProperty("jcifs.smb.client.dfs.disabled", "true");
}
}
示例2: getDeployerProcess
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
@Override
protected BuildProcess getDeployerProcess(@NotNull final BuildRunnerContext context,
@NotNull final String username,
@NotNull final String password,
@NotNull final String target,
@NotNull final List<ArtifactsCollection> artifactsCollections) throws RunBuildException {
final Map<String, String> runnerParameters = context.getRunnerParameters();
final String authMethod = runnerParameters.get(FTPRunnerConstants.PARAM_AUTH_METHOD);
if (FTPRunnerConstants.AUTH_METHOD_USER_PWD.equals(authMethod)) {
return new FtpBuildProcessAdapter(context, target, username, password, artifactsCollections);
} else if (FTPRunnerConstants.AUTH_METHOD_ANONYMOUS.equals(authMethod)) {
return new FtpBuildProcessAdapter(context, target, "anonymous", " ", artifactsCollections);
} else {
throw new RunBuildException("Unknown FTP authentication method: [" + authMethod + "]");
}
}
示例3: getDeployerProcess
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
@Override
protected BuildProcess getDeployerProcess(@NotNull final BuildRunnerContext context,
@NotNull final String username,
@NotNull final String password,
@NotNull final String target,
@NotNull final List<ArtifactsCollection> artifactsCollections) throws RunBuildException {
final SSHSessionProvider provider = new SSHSessionProvider(context, myInternalProperties, mySshKeyManager);
final String transport = context.getRunnerParameters().get(SSHRunnerConstants.PARAM_TRANSPORT);
if (SSHRunnerConstants.TRANSPORT_SCP.equals(transport)) {
return new ScpProcessAdapter(context, artifactsCollections, provider);
} else if (SSHRunnerConstants.TRANSPORT_SFTP.equals(transport)) {
return new SftpBuildProcessAdapter(context, artifactsCollections, provider);
} else {
throw new RunBuildException("Unknown ssh transport [" + transport + "]");
}
}
示例4: makeProgramCommandLine
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的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);
}
示例5: AnsibleOutputListener
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public AnsibleOutputListener(AgentRunningBuild build, BuildRunnerContext buildRunnerContext, ArtifactsWatcher artifactsWatcher) {
this.artifactsWatcher = artifactsWatcher;
this.buildRunnerContext = buildRunnerContext;
File tmpDir = new File(build.getBuildTempDirectory(), "ansible-run");
boolean exists = tmpDir.exists();
if (!exists) {
exists = tmpDir.mkdir();
}
if (!exists) {
LOG.error("Cannot create a directory " + tmpDir.getAbsolutePath() + " for ansible run raw output storage");
build.getBuildLogger().warning("Cannot create a directory for ansible run raw output storage. Ansible report will not be generated");
} else {
String rawFileName = "ansible-run-raw-" + buildRunnerContext.getId() + ".log";
rawFile = new File(tmpDir, rawFileName);
try {
rawFile.createNewFile();
} catch (IOException e) {
LOG.error("Cannot create a file " + rawFileName + " for ansible run raw output writing ", e);
build.getBuildLogger().warning("Cannot create a file for ansible run raw output writing. Ansible report will not be generated");
}
build.addSharedConfigParameter(AnsibleRunnerConstants.ARTIFACTS_TMP_DIR_KEY, tmpDir.getAbsolutePath());
}
}
示例6: executeCommandLine
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
@NotNull
public BuildProcess executeCommandLine(@NotNull BuildRunnerContext hostContext,
@NotNull Collection<String> argz,
@NotNull File workingDir,
@NotNull final Map<String, String> additionalEnvironment) throws RunBuildException {
BuildRunnerContext context = myFacade.createBuildRunnerContext(
hostContext.getBuild(),
SimpleRunnerConstants.TYPE,
workingDir.getPath(),
hostContext
);
for (Map.Entry<String, String> entry : additionalEnvironment.entrySet()) {
context.addEnvironmentVariable(entry.getKey(), entry.getValue());
}
final List<String> newArgz = new ArrayList<String>(argz);
final String commandLine = joinCommandLineArguments(newArgz);
hostContext.getBuild().getBuildLogger().message("Executing command: " + commandLine);
context.addRunnerParameter(SimpleRunnerConstants.USE_CUSTOM_SCRIPT, "true");
context.addRunnerParameter(SimpleRunnerConstants.SCRIPT_CONTENT, commandLine);
return myFacade.createExecutable(hostContext.getBuild(), context);
}
示例7: makeProgramCommandLine
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@NotNull
@Override
public ProgramCommandLine makeProgramCommandLine() throws RunBuildException {
BuildProgressLogger buildLogger = getLogger();
BuildRunnerContext buildRunnerContext = getRunnerContext();
Map<String, String> programEnvironmentVariables = buildRunnerContext.getBuildParameters().getEnvironmentVariables();
String programPath = getProgramPath();
List<String> programArgs = getProgramArgs();
buildLogger.message("Program environment variables: " + programEnvironmentVariables.toString());
buildLogger.message("Program working directory: " + workingDirectory);
buildLogger.message("Program path: " + programPath);
buildLogger.message("Program args: " + programArgs.toString());
return new SimpleProgramCommandLine(programEnvironmentVariables, workingDirectory, programPath, programArgs);
}
示例8: setDejagnuParameters
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
/**
* set need for Dejagnu testing framework parameters.
* @param runner
*/
void setDejagnuParameters(@NotNull final BuildRunnerContext runner){
if (!isExistedTool()){
return;
}
final List<Pair<String, String>> params = getDejagnuParameters(myVersion);
for(final Pair<String, String> parameter : params){
runner.getBuild().addSharedEnvironmentVariable(parameter.first, parameter.second);
}
}
示例9: createBuildProcess
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
@Override
public BuildProcess createBuildProcess(AgentRunningBuild agentRunningBuild,
BuildRunnerContext buildRunnerContext) throws RunBuildException {
return new AutomateWebsiteBuildProcess(BuildProcessConfig.of(buildRunnerContext.getRunnerParameters(),
buildRunnerContext.getConfigParameters()),
agentRunningBuild.getBuildLogger());
}
示例10: setUp
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
@BeforeMethod
public void setUp()
{
myCtx = new Mockery();
myBuildRunnerContextProvider = myCtx.mock(BuildRunnerContextProvider.class);
myBuildRunnerContext = myCtx.mock(BuildRunnerContext.class);
}
示例11: FtpBuildProcessAdapter
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public FtpBuildProcessAdapter(@NotNull final BuildRunnerContext context,
@NotNull final String target,
@NotNull final String username,
@NotNull final String password,
@NotNull final List<ArtifactsCollection> artifactsCollections) {
super(context.getBuild().getBuildLogger());
myIsActive = "ACTIVE".equals(context.getRunnerParameters().get(FTPRunnerConstants.PARAM_FTP_MODE));
myTarget = target.toLowerCase().startsWith(FTP_PROTOCOL) ? target : FTP_PROTOCOL + target;
myUsername = username;
myPassword = password;
myArtifacts = artifactsCollections;
myTransferMode = context.getRunnerParameters().get(FTPRunnerConstants.PARAM_TRANSFER_MODE);
mySecureMode = context.getRunnerParameters().get(FTPRunnerConstants.PARAM_SSL_MODE);
}
示例12: CargoBuildProcessAdapter
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public CargoBuildProcessAdapter(@NotNull String target,
@NotNull String username,
@NotNull String password,
@NotNull BuildRunnerContext context,
@NotNull String sourcePath) {
super(context.getBuild().getBuildLogger());
myHost = getHost(target);
myPort = getPort(target);
myUsername = username;
myPassword = password;
myContext = context;
mySourcePath = sourcePath;
myContainerType = context.getRunnerParameters().get(DeployerRunnerConstants.PARAM_CONTAINER_TYPE);
myUseHttps = Boolean.valueOf(context.getRunnerParameters().get(CargoRunnerConstants.USE_HTTPS));
}
示例13: ScpProcessAdapter
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public ScpProcessAdapter(@NotNull final BuildRunnerContext context,
@NotNull final List<ArtifactsCollection> artifactsCollections,
@NotNull final SSHSessionProvider sessionProvider) {
super(context.getBuild().getBuildLogger());
myArtifacts = artifactsCollections;
mySessionProvider = sessionProvider;
}
示例14: SftpBuildProcessAdapter
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public SftpBuildProcessAdapter(@NotNull final BuildRunnerContext context,
@NotNull final List<ArtifactsCollection> artifactsCollections,
@NotNull final SSHSessionProvider sessionProvider) {
super(context.getBuild().getBuildLogger());
myArtifacts = artifactsCollections;
mySessionProvider = sessionProvider;
}
示例15: SSHSessionProvider
import jetbrains.buildServer.agent.BuildRunnerContext; //导入依赖的package包/类
public SSHSessionProvider(@NotNull final BuildRunnerContext context,
@NotNull final InternalPropertiesHolder holder,
@NotNull final AgentRunningBuildSshKeyManager sshKeyManager) {
mySshKeyManager = sshKeyManager;
final String target = context.getRunnerParameters().get(DeployerRunnerConstants.PARAM_TARGET_URL);
final String portStr = context.getRunnerParameters().get(SSHRunnerConstants.PARAM_PORT);
try {
myPort = Integer.parseInt(portStr);
} catch (NumberFormatException e) {
myPort = 22;
}
final int delimiterIndex = target.indexOf(':');
if (delimiterIndex > 0) {
myHost = target.substring(0, delimiterIndex);
final String remotePath = target.substring(delimiterIndex + 1);
myRemotePath = remotePath.trim().replaceAll("\\\\", "/");
if (new File(myRemotePath).isAbsolute() && !myRemotePath.startsWith("/")) {
myRemotePath = "/" + myRemotePath;
}
} else {
myHost = target;
myRemotePath = "";
}
myContext = context;
myHolder = holder;
}