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:
- 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.
- Build Queued (performed by the server) — The server decides which agents can execute the build and queues the build.
- 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.
- Update Source (performed by the agent) — The agent runs the
Repository#retrieveSourceCodeis called. If the Repository is
RepositoryEventAwarethe 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.
- 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
CustomPreBuildActionplugin point. From this point on, the build will be saved.
- Executes the Build (performed by the agent) — Timer begins. The agent runs the
Builder#executeBuild. After the Builder has been run, all the
CustomBuildProcessorsare run. Timer is stopped.
- 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
- On BuildCompletedEvent (performed by the server) — Notifications are sent in this phase.