本文整理汇总了Java中jetbrains.buildServer.agent.BuildProcess类的典型用法代码示例。如果您正苦于以下问题:Java BuildProcess类的具体用法?Java BuildProcess怎么用?Java BuildProcess使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BuildProcess类属于jetbrains.buildServer.agent包,在下文中一共展示了BuildProcess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDeployerProcess
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的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 + "]");
}
}
示例2: getDeployerProcess
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的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 + "]");
}
}
示例3: asBuildProcess
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@NotNull
public BuildProcess asBuildProcess() {
return new DelegatingBuildProcess(new DelegatingBuildProcess.Action() {
@NotNull
@Override
public BuildProcess startImpl() throws RunBuildException {
return myTryProcess;
}
@Override
public void finishedImpl() {
catchIt("Failed to execute finally steps", new Action() {
@Override
public void execute() throws RunBuildException {
myFinallyProcess.start();
}
});
catchIt("Failed to execute finally steps", new Action() {
@Override
public void execute() throws RunBuildException {
myFinallyProcess.waitFor();
}
});
}
});
}
示例4: waitForImpl
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@NotNull
protected BuildFinishedStatus waitForImpl() throws RunBuildException {
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
for (BuildProcess proc = myProcessList.poll(); proc != null; proc = myProcessList.poll()) {
myCurrentProcess.set(proc);
try {
proc.start();
final BuildFinishedStatus status = proc.waitFor();
if (status != BuildFinishedStatus.INTERRUPTED && status != BuildFinishedStatus.FINISHED_SUCCESS) return status;
} finally {
myCurrentProcess.set(null);
}
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
}
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
return BuildFinishedStatus.FINISHED_SUCCESS;
}
示例5: executeCommandLine
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的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);
}
示例6: block
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@NotNull
public static BuildProcess block(@NotNull final BuildProgressLogger logger,
@NotNull final String blockName,
@NotNull final String blockText,
@NotNull final BuildProcess proc) {
return new DelegatingBuildProcess(new DelegatingBuildProcess.Action() {
@NotNull
@Override
public BuildProcess startImpl() throws RunBuildException {
logger.activityStarted(blockName, blockText, "vm");
return proc;
}
@Override
public void finishedImpl() {
logger.activityFinished(blockName, "vm");
}
});
}
示例7: test_interrupted_in_startImpl
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void test_interrupted_in_startImpl() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingAction(FINISHED_SUCCESS){
@NotNull
@Override
public BuildProcess startImpl() throws RunBuildException {
bp.get().interrupt();
return super.startImpl();
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例8: test_interrupted_in_process_start
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void test_interrupted_in_process_start() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingActionBase(){
@Override
protected RecordingBuildProcess createSub() {
return new RecordingBuildProcess("i", BuildFinishedStatus.FINISHED_SUCCESS){
@Override
public void start() throws RunBuildException {
super.start();
bp.get().interrupt();
}
};
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","interrupt-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例9: test_interrupted_in_process_finish
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void test_interrupted_in_process_finish() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingActionBase(){
@Override
protected RecordingBuildProcess createSub() {
return new RecordingBuildProcess("i", BuildFinishedStatus.FINISHED_SUCCESS){
@NotNull
@Override
public BuildFinishedStatus waitFor() throws RunBuildException {
bp.get().interrupt();
return super.waitFor();
}
};
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","interrupt-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例10: test_interrupted_in_process_finishImpl
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void test_interrupted_in_process_finishImpl() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingAction(BuildFinishedStatus.FINISHED_SUCCESS){
@Override
public void finishedImpl() {
bp.get().interrupt();
super.finishedImpl();
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例11: createBuildProcess
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Override
public BuildProcess createBuildProcess(AgentRunningBuild agentRunningBuild,
BuildRunnerContext buildRunnerContext) throws RunBuildException {
return new AutomateWebsiteBuildProcess(BuildProcessConfig.of(buildRunnerContext.getRunnerParameters(),
buildRunnerContext.getConfigParameters()),
agentRunningBuild.getBuildLogger());
}
示例12: runProcess
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
public static void runProcess(final BuildProcess process, final int timeout) throws RunBuildException {
process.start();
new WaitFor(timeout) {
@Override
protected boolean condition() {
return process.isFinished();
}
};
assertThat(process.isFinished()).describedAs("Failed to finish test in time").isTrue();
assertThat(process.waitFor()).isEqualTo(BuildFinishedStatus.FINISHED_SUCCESS);
}
示例13: testSimpleTransfer
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void testSimpleTransfer() throws Exception {
myArtifactsCollections.add(DeployTestUtils.buildArtifactsCollection(myTempFiles, "dest1", "dest2"));
final BuildProcess process = getProcess(HOST_ADDR);
DeployTestUtils.runProcess(process, 5000);
DeployTestUtils.assertCollectionsTransferred(myRemoteDir, myArtifactsCollections);
}
示例14: testTransferToRelativePath
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void testTransferToRelativePath() throws Exception {
final String subPath = "test_path/subdir";
myArtifactsCollections.add(DeployTestUtils.buildArtifactsCollection(myTempFiles, "dest1", "dest2"));
final BuildProcess process = getProcess(HOST_ADDR + ":" + subPath);
DeployTestUtils.runProcess(process, 5000);
DeployTestUtils.assertCollectionsTransferred(new File(myRemoteDir, subPath), myArtifactsCollections);
}
示例15: testTransferToRelativeTargetAndEmptyPath
import jetbrains.buildServer.agent.BuildProcess; //导入依赖的package包/类
@Test
public void testTransferToRelativeTargetAndEmptyPath() throws Exception {
final String subPath = "test_path/subdir";
myArtifactsCollections.add(DeployTestUtils.buildArtifactsCollection(myTempFiles, ""));
final BuildProcess process = getProcess(HOST_ADDR + ":" + subPath);
DeployTestUtils.runProcess(process, 5000);
DeployTestUtils.assertCollectionsTransferred(new File(myRemoteDir, subPath), myArtifactsCollections);
}