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


Java BuildProcess类代码示例

本文整理汇总了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 + "]");
  }

}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:19,代码来源:FtpDeployerRunner.java

示例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 + "]");
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:18,代码来源:SSHDeployerRunner.java

示例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();
        }
      });
    }
  });
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:27,代码来源:TryFinallyBuildProcessImpl.java

示例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;
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:18,代码来源:CompositeBuildProcessImpl.java

示例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);
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:27,代码来源:CommandlineBuildProcessFactoryImpl.java

示例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");
    }
  });
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:20,代码来源:BaseVM.java

示例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());
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:19,代码来源:DelegatingBuildProcessTest.java

示例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());
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:23,代码来源:DelegatingBuildProcessTest.java

示例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());
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:24,代码来源:DelegatingBuildProcessTest.java

示例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());
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:18,代码来源:DelegatingBuildProcessTest.java

示例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());
}
 
开发者ID:automate-website,项目名称:teamcity-plugin,代码行数:8,代码来源:AutomateWebsiteAgentBuildRunner.java

示例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);
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:12,代码来源:DeployTestUtils.java

示例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);
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:8,代码来源:BaseSSHTransferTest.java

示例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);
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:9,代码来源:BaseSSHTransferTest.java

示例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);
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:9,代码来源:BaseSSHTransferTest.java


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