Task groups
When working in a team or organization that has more than one pipeline, it often doesn't take long before multiple pipelines that take the same shape emerge. For example, in some companies, all pipelines contain tasks for security scanning, running tests, and calculating the test coverage.
Instead of repeating these tasks everywhere, they can be extracted from an existing pipeline into a task group. Task groups, in turn, can be used within multiple pipelines as if they are tasks themselves. Doing this reduces the effort needed to create a new pipeline or update all the pipelines with a new requirement. Doing this also ensures that all the pipelines using the task group have the same task configuration.
To create a new task group, open any existing build definition and go through the following steps:
- Select one or more tasks by clicking on them while holding down Ctrl, or by using the selectors that appear when hovering the mouse over a task.
- Right-click on the selection and select Create task group.
- In the popup that now appears (not shown in the screenshot), choose a name, description, and category for the task group. If any of the selected tasks have a variable value specified, you can now provide a default value and description for these parameters. These parameters will be available within the task group and need to be configured when the task group is used.
- After clicking Create (not shown in the screenshot), the existing build definition is updated by removing the selected tasks and replacing them with the new task group.
Adding an already existing task group to a build or release definition is done in precisely the same way as adding regular tasks. Task groups show up in the same list of tasks to choose from.
A list of all the existing task groups can be found by navigating to the Pipelines menu and then Task groups. To edit an existing task group, select it in the list that is shown, and select the Edit option. Editing task groups works in precisely the same way as editing a build definition.
This section was all about creating a build definition and describing how an application should be built. The next section is about executing the build.