Configuring tasks

A task:
  • Is a small discrete unit of work, such as source code checkout, executing a Maven goal, running a script, or parsing test results.
  • Is run sequentially within a job on a Bamboo working directory.

Tasks may make use of an executable if required. Tasks are configured within the scope of a job. A job can be configured to execute a number of tasks, on the same working directory. For example, before executing a Maven goal, the user could substitute specific files within the working directory, substitute version numbers, check out source repositories, or execute a script.

Final tasks for a job are always executed, even if previous tasks in the job failed.

Create a task for a job

When creating a new job or configuring an existing one, you need to specify the tasks that will execute the job's builds. You must specify an executable for each task. If you specify an Ant, Grails or Maven executable, you will also need to choose a JDK.

When creating a new plan, you can configure the tasks for the plan's default job.

To create a task for a job:

  1. Navigate to the tasks configuration for a job. Do this by:
  2. Select Add task.
  3. Select the task type.
  4. Complete the following fields that are common to all task types:

    Task description
    Enter a description of the task, for display in Bamboo.

    Disable this task
    Check, or clear, to selectively run this task.

    Add condition to task
    Make task run only when a certain condition is met. 
  5. Complete the remaining fields, which are specific for individual task types. See the following pages for further details:
  6. Select Save.

Task type list for a new task

Order the tasks in a job

Tasks can be designated as build tasks or final tasks in a job:

  • Build tasks will run sequentially in the order specified in the job. If a Build task fails, all subsequent tests will not be executed.
  • Final tasks will run sequentially, once the build tasks have completed. Final tasks will always be executed, regardless of whether any Build tasks or other Final tasks fail. Final tasks will be executed even if you stopped the build manually.

To order the tasks for a job:

  1. Navigate to the tasks for the desired job.
  2. Drag and drop the tasks into the desired order in the table on the left. If you want to change a Build task to a Final task or vice versa, drag and drop it under the desired header in the table. Your changes will be saved immediately.

Tasks order in task configuration screen

Notes

  • Adding new executables — At least one executable is configured automatically after installing Bamboo. You can add more executables of different types as described in Configuring a new executable.
  • Adding new JDKs — At least one JDK is configured automatically after installing Bamboo. You can add more JDKs as described in Defining a new JDK capability.
  • About the Compatibility task — The Compatibility task is created by Bamboo when upgrading from Bamboo 3.0 or earlier and Bamboo cannot match a builder to a task. This may occur if you are using a builder enabled by a custom plugin.

Last modified on Oct 6, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.