jetbrains.buildServer.serverSide.SFinishedBuild Java Examples

The following examples show how to use jetbrains.buildServer.serverSide.SFinishedBuild. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: S3CleanupExtension.java    From teamcity-s3-artifact-storage-plugin with Apache License 2.0 6 votes vote down vote up
@Override
public void cleanupBuildsData(@NotNull BuildCleanupContext cleanupContext) {
  for (SFinishedBuild build : cleanupContext.getBuilds()) {
    try {
      final ArtifactListData artifactsInfo = myHelper.getArtifactList(build);
      if (artifactsInfo == null) {
        continue;
      }
      final String pathPrefix = S3Util.getPathPrefix(artifactsInfo);
      if (pathPrefix == null) {
        continue;
      }

      List<String> pathsToDelete = ArtifactPathsEvaluator.getPathsToDelete((BuildCleanupContextEx)cleanupContext, build, artifactsInfo);
      if (pathsToDelete.isEmpty()) {
        continue;
      }

      doClean(cleanupContext.getErrorReporter(), build, pathPrefix, pathsToDelete);
    } catch (Throwable e) {
      Loggers.CLEANUP.debug(e);
      cleanupContext.getErrorReporter().buildCleanupError(build.getBuildId(), "Failed to remove S3 artifacts: " + e.getMessage());
    }
  }
}
 
Example #2
Source File: S3CleanupExtension.java    From teamcity-s3-artifact-storage-plugin with Apache License 2.0 5 votes vote down vote up
@NotNull
private String progressMessage(@NotNull final SFinishedBuild build,
                               @NotNull final List<String> pathsToDelete,
                               @NotNull final AtomicInteger succeededNum,
                               @NotNull final AtomicInteger currentChunkNumber,
                               final int size,
                               final int chunkSize) {
  return "Cleaning artifacts of Build " + LogUtil.describe(build) + ": " +
         "S3Client deleting chunk #" + currentChunkNumber.incrementAndGet() + "/" + size + " of " + chunkSize + "/" + (pathsToDelete.size() - succeededNum.get()) + " objects";
}
 
Example #3
Source File: ReportsMain.java    From appengine-tck with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public SFinishedBuild getPreviousFinished() {
    return null;
}