Pipeline templates are only available on an Enterprise plan.
Pipeline templates allow you to define standard pipeline step configurations to use across all the pipelines in your organization.
When a pipeline has a template assigned, the pipeline inherits its step configuration from the template.
Before assigning a template to a pipeline, you need to mark that template as available for use in your organization.
Only administrators can create or update pipeline templates. You can do this through the Buildkite UI or the REST and GraphQL APIs.
To create a template:
- Navigate to your organization’s pipeline templates.
- If this is your first template, select Create a Template. Otherwise, select New Template.
- Enter the name and description for your new template.
- Update the default step configuration.
- Select Available for assignment by non-admins if you would like everyone in your organization to be able to use this template when creating pipelines or editing pipeline steps.
- Select Create Template.
An administrator can add multiple templates to use across the organization. Making changes and saving a template will apply those changes to all pipelines using that template.
As an administrator you do not need to mark a template available to see it in the available templates dropdown. You will be able to see all the templates you created while creating a new build, creating a new pipeline or editing steps for an existing pipeline.
An administrator can test a pipeline template against a pipeline using the New Build button on the pipeline page.
If a template exists for the organization, it can be selected from the Pipeline template dropdown to create a new build using the step configuration from that template.
The power of pipeline templates comes from how much you require their use. Administrators can select from the following options, listed in increasing strictness:
- Do not require pipeline templates: Pipeline steps remain editable for any user with permission to create or update a pipeline. Templates marked as available can be assigned to pipelines. Use this option if you would like your pipeline templates to act more like starting guides for users in your organization to create pipelines faster.
- Require a pipeline template on new pipelines: A template must be selected when creating a new pipeline. The step configuration of existing pipelines will become read-only. Pipelines can be assigned a template individually, making a gradual migration to pipeline templates possible.
- Requiring a pipeline template for everything: Templates are mandatory on all new and existing pipelines. When choosing this setting, you will select a pipeline template to apply to any pipeline that does not already have a template assigned.
To change your organization's requirements for pipeline templates:
- Navigate to your organization's pipeline templates.
- Check you have at least one template. If you don't have a template, create one.
- Select Settings.
- Select the requirement you want to set.
If you stop requiring pipeline templates for your organization, any pipelines using templates will continue to do so. You can later change their steps settings to remove the template.
After an administrator marks a pipeline template available for use, anyone with permission to create or change a pipeline can assign a template. Assigning a template overrides the pipeline's step configuration with the template.
You can use the following methods to assign a template to a pipeline:
- On the step settings for the pipeline (Pipeline > Settings > Steps), select the template to assign.
- Using the REST API, update the pipeline with the appropriate
- Using the GraphQL API, run the
pipelineUpdatemutation with the appropriate
You can find the IDs for a pipeline template on its page in the Buildkite dashboard.
Pipelines defined using the web steps editor cannot be assigned templates through the Buildkite dashboard. These pipelines must be either migrated to YAML steps first, updated using the APIs, or bulk-assigned a template when selecting the Require a pipeline template for everything setting.