Add a contrib document to show how to test scaffolder templates locally

Signed-off-by: Axel Hecht <axel@pike.org>
This commit is contained in:
Axel Hecht
2022-10-04 18:34:49 +02:00
parent 037b4393c4
commit aedf8c86d1
2 changed files with 184 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# Scaffolder contrib tools
## Testing Templates with Dry-run
Scaffolder templates support anything that backstage.io and custom actions can do, so testing them is hard without actually running the instance of Backstage that they're designed for.
The [commandline script](template-testing-dry-run.md) might offer a way for you to do so using the dry-run API used for the Template Editor. Run it against a running instance, either locally or remote, and use it like
```sh
scaffolder-dry http://localhost:7007/ template-directory values.yml output-directory
```
If you're using backend-to-backend authentication, either
- pass a front-end auth token from a current browser session via `--token $FRONTEND_TOKEN`,
- have the tool create a b2b token for a given base64 encoded backend secret via `--backend-secret $BACKEND_SECRET`.