Last updated Dec 8, 2017

Updates to the build processing plugins

The various pre and post build plugin points have been updated to to reflect the new build agent task structure.

  • com.atlassian.bamboo.build.CustomPreBuildAction
  • com.atlassian.bamboo.build.CustomBuildProcessor
  • com.atlassian.bamboo.build.CustomBuildProcessorServer

Essentially the method:

1
2
public void run(Build build, BuildResults buildResult);

has been replaced with the BuildTask interface.

1
2
/**
 * Interface the defines a basic interface for a task in Bamboo. All {@link #call()} methods return {@link BuildContext}
 * objects.
 */
public interface BuildTask extends Callable<BuildContext>
{
    void init(@NotNull BuildContext buildContext);

    /**
     * <p>Execute the build task.</p>
     *
     * <p>Implementations should regularly check if the calling {@link Thread} has been interrupted.</p>
     *
     * @return
     * @throws InterruptedException if the calling {@link Thread} has been interrupted.
     * @throws Exception A general exception that will be handled.
     */
    @NotNull
    BuildContext call() throws InterruptedException, Exception;
}

You should be able to access most of the things you need through the BuildContext that can be retained from the init method.

Rate this page: