Last updated Dec 8, 2017

Build process for 2.0

The build process has been refactored in Bamboo 2.0 into a series of BuildTasks, each responsible for a particular part of the build process. Each build task has the ability to store a BuildContext. A BuildContext represents the definition of the part of the build process that the build task is responsible for.

The steps of a build process are described below:

  1. Change Detection (performed by the server) -- Changes are detected via polling, manual builds, etc. When a new build is required, the change logs are defined for the build and the build number for the new build is determined. The build context is also created.
  2. Build Queued (performed by the server) -- The server decides which agents can execute the build and queues the build.
  3. Agent Picks Up Build (performed by the agent) | The capability context is set. The build is removed from queue. The agent begins looping through the build tasks.
  4. Update Source (performed by the agent) -- The agent runs the CheckoutUpdateForBuild task. The Repository#retrieveSourceCode is called. If the Repository is RepositoryEventAware the appropriate methods will be called. The agent checks if the repository has changed since the last build and clears the source directory if it has.
  5. Prepare for the Build (performed by the agent) -- The agent runs the PrepareBuildTask. This begins streaming the logs back to the server. The agent also runs the CustomPreBuildAction plugin point. From this point on, the build will be saved.
  6. Executes the Build (performed by the agent) -- Timer begins. The agent runs the Builder#executeBuild. After the Builder has been run, all the CustomBuildProcessors are run. Timer is stopped.
  7. Results Processing (performed by the server) -- The server runs CustomBuildProcessorServer, checks if the build has passed and saves and indexes the build result. The server also fires off the BuildCompletedEvent and PostBuildCompletedEvent events.
  8. On BuildCompletedEvent (performed by the server) -- Notifications are sent in this phase.

Rate this page: