Adding templates to Scaffolder
Admins can register Cookiecutter templates from a repo directly from the Scaffolder page. Users with admin permissions will see the ability to Add template on the left-hand side.
This will open a modal window where you can enter in the template's essential information.
The template name and description will appear on the Scaffolder page along with the rest of your organization's templates, so you want to make sure this information is especially clear to other users.
If the template is in a GitHub or Azure DevOps repository, you'll be asked to enter the URL for that repository, which can be internal or public. If you're using Bitbucket or GitLab repository, you can select from available configurations.
You also have the option to add a Subdirectory for your Cookiecutter template — this only applies if the template isn't stored at the root of your repository.
The Requires a new service toggle determines whether Cortex will add a new service to the catalog. When this is enabled, you’ll have the chance to enter service owners and other Cortex-related information. When this is disabled, you will not see the service details page during the Scaffolder workflow.
The Requires a new pull request toggle determines whether Cortex will always open a pull request against existing repositories. If this is enabled, Scaffolder can only be used to open pull requests.
There are three ways to configure these settings:
- If Requires a new service is enabled and Requires a new pull request is disabled, then your templatized service will be created in the catalog.
- If Requires a new service is turned off, then Requires a new pull request will always be enabled — if you’re not creating a new service, then it has to open a pull request against an existing one.
- You can also have both Requires a new service and Requires a new pull request enabled. This makes sense if you have a monorepo and you want to create a new service, but that service should be added into an existing repository.
Each template will be tagged with New Service
and/or Opens PR
to make it easy for developers to know how each unique template works before using it.
The Show README.md during Scaffolding toggle will determine whether to display the existing README file for the template you’re using. If there is no existing README, then nothing will appear. If there is a README and this feature is enabled, you’ll see it appear when you work through the Scaffolder workflow. By providing important information upfront, this feature makes it super easy for developers to work with various templates.
When creating a template, you'll also be asked to include Tags. These tags appear in the template library, providing key information to users at a glance.
Users with Edit Scaffolder
permissions can go back and modify a template after it’s been created by clicking the pencil icon next to any template.
With templates, you can effectively enforce standardization across all of your services and maintain a high level of quality across the board.