Setting up Software Templates
Scaffolder actions
Each action field under the steps
section of template.yaml is known as Scaffolder actions.
-
The scaffolder plugin comes with several built-in actions for fetching content, registering in the catalog and of course actions for creating and publishing a git repository.
-
There are several repository providers supported out of the box such as GitHub, Azure, GitLab and Bitbucket. A list of all registered actions can be found under
/create/actions
. For local development you should be able to reach them athttp://localhost:3000/create/actions
.
Some of the most used built-in actions are:
Built-in actions | Description |
---|---|
fetch:plain | Downloads a template and copies the files over without templating |
fetch:cookiecutter | (Use fetch:template over this) Downloads a template from the given URL, and runs cookiecutter on it. |
fetch:template | Downloads a skeleton, templates variables into file and directory names and content, and places the result in a given path |
publish:github publish:gitlab publish:bitbucket publish:azure | Publishes the templated files and folder into a new repository |
publish:github:pull-request | (Used with mono-repos) Creates a Pull Request with the newly created component files |
github:webhook | Creates a GitHub webhook |
fs:delete | Deletes files and directories from the workspace |
catalog:register | Registers entities from a catalog descriptor file in the workspace into the software catalog. |
You can create your own Scaffolder actions for anything you can imagine being used as part of the Create flow in your organization. Read more, Writing Custom Actions
A note on RepoUrlPicker
In the template.yaml
file of the template we created, you must have noticed ui:field: RepoUrlPicker
in the spec.parameters field. This is known as Scaffolder Field Extensions.
These field extensions are used in taking certain types of input from users like GitHub repository URL, teams registered in catalog for the owners field, etc. Such field extensions can also be customized for your own organization. See Writing Custom Field Extensions