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


Java BuildFinishedStatus类代码示例

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


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

示例1: waitBuildFinish

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
public BuildFinishedStatus waitBuildFinish()
        throws InterruptedException {
    boolean buildFinished = false;
    Build childBuild = null;
    while (!buildFinished && !canceled) {
        childBuild = buildsResource.serveBuild(build.getBuildId().toString(), "");
        buildFinished = isBuildFinished(childBuild);
        Thread.sleep(100L);
    }
    buildProgressLogger.message("Build " + build.getBuildId()
            + " is finished with success");
    if (!canceled) {
        if (childBuild.getStatus().equalsIgnoreCase(BuildStatusConst.ERROR)
                || childBuild.getStatus().equalsIgnoreCase(BuildStatusConst.FAILURE)) {
            return BuildFinishedStatus.FINISHED_WITH_PROBLEMS;
        }
    }
    return canceled ? BuildFinishedStatus.INTERRUPTED : BuildFinishedStatus.FINISHED_SUCCESS;
}
 
开发者ID:presidentio,项目名称:teamcity-matrix-build-plugin,代码行数:20,代码来源:QueuedBuild.java

示例2: logJobStatuses

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
private BuildFinishedStatus logJobStatuses(Collection<Job> jobs) {
    BuildFinishedStatus result = BuildFinishedStatus.FINISHED_SUCCESS;

    for (Job job : jobs) {
        String jobTitle = job.getTitle();
        String jobUrl = getJobUrl(job.getId());
        if (job.getStatus() == JobStatus.SUCCESS) {
            logger.message(format("%s job execution succeeded (%s).", jobTitle, jobUrl));
        } else if (job.getStatus() == JobStatus.FAILURE) {
            if (result != BuildFinishedStatus.FINISHED_FAILED) {
                result = BuildFinishedStatus.FINISHED_WITH_PROBLEMS;
            }
            logger.warning(format("%s job execution failed (%s).", jobTitle, jobUrl));
        } else {
            result = BuildFinishedStatus.FINISHED_FAILED;
            logger.error(
                    format("Unexpected error occured during execution of '%s' or execution took to long (%s).",
                            jobTitle, jobUrl));
        }
    }
    return result;
}
 
开发者ID:automate-website,项目名称:teamcity-plugin,代码行数:23,代码来源:AutomateWebsiteBuildProcess.java

示例3: runProcess

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Override
public BuildFinishedStatus runProcess() {
  JSch.setLogger(new JSchBuildLogger(myLogger));
  Session session = null;
  try {
    session = myProvider.getSession();
    return executeCommand(session, myPty, myCommands);
  } catch (JSchException e) {
    myLogger.error(e.toString());
    LOG.warnAndDebugDetails(e.getMessage(), e);
    return BuildFinishedStatus.FINISHED_FAILED;
  } finally {
    if (session != null) {
      session.disconnect();
    }
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:18,代码来源:SSHExecProcessAdapter.java

示例4: waitFor

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@NotNull
@Override
public BuildFinishedStatus waitFor() throws RunBuildException {
    while (!isInterrupted && !isFinished) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RunBuildException(e);
        }
    }

    // MUDO BuildFinishedStatus.FINISHED_WITH_PROBLEMS ??

    return isFinished
            ? (isFailed ? BuildFinishedStatus.FINISHED_FAILED : BuildFinishedStatus.FINISHED_SUCCESS)
            : BuildFinishedStatus.INTERRUPTED;
}
 
开发者ID:rvdginste,项目名称:todo-teamcity-plugin,代码行数:18,代码来源:AbstractBuildProcessAdapter.java

示例5: beforeBuildFinish

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
public void beforeBuildFinish(@NotNull final AgentRunningBuild build, @NotNull final BuildFinishedStatus buildStatus) {
    String tmpDirPath = build.getSharedConfigParameters().get(AnsibleRunnerConstants.ARTIFACTS_TMP_DIR_KEY);
    if (tmpDirPath == null) {
        return;
    }
    File tmpDir = new File(tmpDirPath);
    if (tmpDir.exists() && tmpDir.isDirectory()) {
        File[] rawFiles = tmpDir.listFiles();
        if (rawFiles == null || rawFiles.length == 0) {
            build.getBuildLogger().warning("Build defines ansible-run tmp directory but it doesn't contain any files");
        } else {
            generateReport(build, rawFiles);
        }
    } else {
        build.getBuildLogger().warning("Build defines ansible-run tmp directory but it doesn't exist");
    }
}
 
开发者ID:andreizhuk,项目名称:tc-ansible-runner,代码行数:18,代码来源:AnsibleReportArtifatcsProvider.java

示例6: waitForImpl

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的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

示例7: test_interruptCalledForFirst

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Test
public void test_interruptCalledForFirst() {
  final CompositeBuildProcessImpl i = new CompositeBuildProcessImpl();
  final List<String> log = new ArrayList<String>();
  i.pushBuildProcess(new RecordingBuildProcess("1", BuildFinishedStatus.FINISHED_SUCCESS) {
    @Override
    public void start() throws RunBuildException {
      super.start();
      i.interrupt();
    }
  });
  i.pushBuildProcess(new RecordingBuildProcess("f", BuildFinishedStatus.FINISHED_SUCCESS));

  assertRunSuccessfully(i, BuildFinishedStatus.INTERRUPTED);
  assertLog("start-1", "interrupt-1", "waitFor-1");
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:17,代码来源:CompositeBuildProcessTest.java

示例8: test_interruptCalledForFirst_WaitFor

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Test
public void test_interruptCalledForFirst_WaitFor() {
  final CompositeBuildProcessImpl i = new CompositeBuildProcessImpl();
  i.pushBuildProcess(new RecordingBuildProcess("1", BuildFinishedStatus.FINISHED_SUCCESS) {
    @NotNull
    @Override
    public BuildFinishedStatus waitFor() throws RunBuildException {
      i.interrupt();
      return super.waitFor();
    }
  });
  i.pushBuildProcess(new RecordingBuildProcess("f", BuildFinishedStatus.FINISHED_SUCCESS));

  assertRunSuccessfully(i, BuildFinishedStatus.INTERRUPTED);
  assertLog("start-1", "interrupt-1", "waitFor-1");
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:17,代码来源:CompositeBuildProcessTest.java

示例9: test_interruptCalledForTwo

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Test
public void test_interruptCalledForTwo() {
  final CompositeBuildProcessImpl i = new CompositeBuildProcessImpl();
  i.pushBuildProcess(new RecordingBuildProcess("0", BuildFinishedStatus.FINISHED_SUCCESS));
  i.pushBuildProcess(new RecordingBuildProcess("1", BuildFinishedStatus.FINISHED_SUCCESS) {
    @Override
    public void start() throws RunBuildException {
      super.start();
      i.interrupt();
    }
  });
  i.pushBuildProcess(new RecordingBuildProcess("f", BuildFinishedStatus.FINISHED_SUCCESS));

  assertRunSuccessfully(i, BuildFinishedStatus.INTERRUPTED);
  assertLog("start-0", "waitFor-0", "start-1", "interrupt-1", "waitFor-1");
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:17,代码来源:CompositeBuildProcessTest.java

示例10: test_interruptCalledForTwo_WaitFor

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Test
public void test_interruptCalledForTwo_WaitFor() {
  final CompositeBuildProcessImpl i = new CompositeBuildProcessImpl();
  i.pushBuildProcess(new RecordingBuildProcess("0", BuildFinishedStatus.FINISHED_SUCCESS));
  i.pushBuildProcess(new RecordingBuildProcess("1", BuildFinishedStatus.FINISHED_SUCCESS) {
    @NotNull
    @Override
    public BuildFinishedStatus waitFor() throws RunBuildException {
      i.interrupt();
      return super.waitFor();
    }
  });
  i.pushBuildProcess(new RecordingBuildProcess("f", BuildFinishedStatus.FINISHED_SUCCESS));

  assertRunSuccessfully(i, BuildFinishedStatus.INTERRUPTED);
  assertLog("start-0", "waitFor-0", "start-1", "interrupt-1", "waitFor-1");
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:18,代码来源:CompositeBuildProcessTest.java

示例11: test_interrupted_in_process_start

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的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

示例12: test_interrupted_in_process_finish

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的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

示例13: test_interrupted_in_process_finishImpl

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的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

示例14: should_not_fail_on_finally_error

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Test
public void should_not_fail_on_finally_error() {
  TryFinallyBuildProcessImpl bp = create();

  bp.addFinishProcess(new RecordingBuildProcess("finally-1", BuildFinishedStatus.FINISHED_SUCCESS) {
    {
      setFinishException(new RunBuildException("ppp"));
    }
  });
  bp.addFinishProcess(new RecordingBuildProcess("finally-2", BuildFinishedStatus.FINISHED_SUCCESS));

  //TODO: error status is not propagated here.
  //TODO: The only changes is we report error on that from the runner
  assertRunSuccessfully(bp.asBuildProcess(), BuildFinishedStatus.FINISHED_SUCCESS);
  assertLog("start-finally-1",
          "waitFor-finally-1",
          "error-ppp",
          "start-finally-2",
          "waitFor-finally-2");
}
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:21,代码来源:TryFinallyBuildProcessTest.java

示例15: waitFor

import jetbrains.buildServer.agent.BuildFinishedStatus; //导入依赖的package包/类
@Override
public @NotNull BuildFinishedStatus waitFor() throws RunBuildException {
    while (!isInterrupted() && !hasFinished) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RunBuildException(e);
        }
    }
    return hasFinished ?
            hasFailed ? BuildFinishedStatus.FINISHED_FAILED :
                    BuildFinishedStatus.FINISHED_SUCCESS :
            BuildFinishedStatus.INTERRUPTED;
}
 
开发者ID:gonzadocarmo,项目名称:teamcity-s3-plugin,代码行数:15,代码来源:AWSS3BuildProcessAdapter.java


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