From e5f61559d5a9e90e210c4d0635948e6e2cb09b96 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Wed, 7 Dec 2022 08:00:47 +0000 Subject: [PATCH 1/4] use nunjucks "square bracket syntax" for steps in docs Signed-off-by: Brian Fletcher --- docs/features/software-catalog/descriptor-format.md | 2 +- docs/features/software-templates/adding-templates.md | 2 +- .../migrating-from-v1beta2-to-v1beta3.md | 10 +++++----- docs/features/software-templates/writing-templates.md | 10 +++++----- .../default-app/examples/template/template.yaml | 6 +++--- .../sample-templates/bitbucket-demo/template.yaml | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index 27b26659cf..be71c9d174 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -703,7 +703,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + repoContentsUrl: '{{ steps["publish"].output.repoContentsUrl }}' catalogInfoPath: '/catalog-info.yaml' ``` diff --git a/docs/features/software-templates/adding-templates.md b/docs/features/software-templates/adding-templates.md index e8176a688b..e11dad2acb 100644 --- a/docs/features/software-templates/adding-templates.md +++ b/docs/features/software-templates/adding-templates.md @@ -76,7 +76,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' ``` diff --git a/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md b/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md index a2277e096c..c36f02a3df 100644 --- a/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md +++ b/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md @@ -169,14 +169,14 @@ These should be moved to `links` under the `output` object instead. ```diff output: -- remoteUrl: '{{ steps.publish.output.remoteUrl }}' -- entityRef: '{{ steps.register.output.entityRef }}' +- remoteUrl: '{{ steps["publish"].output.remoteUrl }}' +- entityRef: '{{ steps["register"].output.entityRef }}' + links: + - title: Repository -+ url: ${{ steps.publish.output.remoteUrl }} ++ url: ${{ steps["publish"].output.remoteUrl }} + - title: Open in catalog + icon: catalog -+ entityRef: ${{ steps.register.output.entityRef }} ++ entityRef: ${{ steps["register"].output.entityRef }} ``` @@ -206,7 +206,7 @@ Alternatively, it's possible to keep the `dash-case` syntax and use brackets for ```yaml input: - repoUrl: ${{ steps['my-custom-action'].output.repoUrl }} + repoUrl: ${{ steps["my-custom-action"].output.repoUrl }} ``` ### Summary diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 826121bd02..d53ce3716c 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -88,17 +88,17 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' # some outputs which are saved along with the job for use in the frontend output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps["publish"].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps["register"].output.entityRef }} ``` Let's dive in and pick apart what each of these sections do and what they are. @@ -505,10 +505,10 @@ The main two that are used are the following: output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} # link to the remote repository + url: ${{ steps["publish"].output.remoteUrl }} # link to the remote repository - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} # link to the entity that has been ingested to the catalog + entityRef: ${{ steps["register"].output.entityRef }} # link to the entity that has been ingested to the catalog ``` ## The templating syntax diff --git a/packages/create-app/templates/default-app/examples/template/template.yaml b/packages/create-app/templates/default-app/examples/template/template.yaml index 50052b7a7c..39c5d2326f 100644 --- a/packages/create-app/templates/default-app/examples/template/template.yaml +++ b/packages/create-app/templates/default-app/examples/template/template.yaml @@ -61,14 +61,14 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' # Outputs are displayed to the user after a successful execution of the template. output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps["publish"].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps["register"].output.entityRef }} diff --git a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml index 52714f6d73..8fd60b594a 100644 --- a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml @@ -68,13 +68,13 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps["publish"].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps["register"].output.entityRef }} From 935b66a646bf16338e4cf510414493e7a775ba2d Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Wed, 7 Dec 2022 08:10:42 +0000 Subject: [PATCH 2/4] add changeset Signed-off-by: Brian Fletcher --- .changeset/dirty-ads-refuse.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/dirty-ads-refuse.md diff --git a/.changeset/dirty-ads-refuse.md b/.changeset/dirty-ads-refuse.md new file mode 100644 index 0000000000..9c982199e7 --- /dev/null +++ b/.changeset/dirty-ads-refuse.md @@ -0,0 +1,6 @@ +--- +'@backstage/create-app': patch +'@backstage/plugin-scaffolder-backend': patch +--- + +Change step output template examples to use square bracket syntax. From 626a71fa06571f8808b1468a9ae930fc8230b0e3 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Wed, 7 Dec 2022 13:03:27 +0000 Subject: [PATCH 3/4] fix review comments Signed-off-by: Brian Fletcher --- docs/features/software-catalog/descriptor-format.md | 2 +- docs/features/software-templates/adding-templates.md | 2 +- .../migrating-from-v1beta2-to-v1beta3.md | 10 +++++----- docs/features/software-templates/writing-templates.md | 10 +++++----- .../default-app/examples/template/template.yaml | 2 +- .../scaffolder-backend-module-cookiecutter/README.md | 6 +++--- plugins/scaffolder-backend-module-rails/README.md | 6 +++--- plugins/scaffolder-backend-module-yeoman/README.md | 6 +++--- .../sample-templates/bitbucket-demo/template.yaml | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index be71c9d174..6596e65464 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -703,7 +703,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: '{{ steps["publish"].output.repoContentsUrl }}' + repoContentsUrl: {{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' ``` diff --git a/docs/features/software-templates/adding-templates.md b/docs/features/software-templates/adding-templates.md index e11dad2acb..6b0e2330a4 100644 --- a/docs/features/software-templates/adding-templates.md +++ b/docs/features/software-templates/adding-templates.md @@ -76,7 +76,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' ``` diff --git a/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md b/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md index c36f02a3df..6e37a4df3e 100644 --- a/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md +++ b/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3.md @@ -169,14 +169,14 @@ These should be moved to `links` under the `output` object instead. ```diff output: -- remoteUrl: '{{ steps["publish"].output.remoteUrl }}' -- entityRef: '{{ steps["register"].output.entityRef }}' +- remoteUrl: {{ steps['publish'].output.remoteUrl }} +- entityRef: {{ steps['register'].output.entityRef }} + links: + - title: Repository -+ url: ${{ steps["publish"].output.remoteUrl }} ++ url: ${{ steps['publish'].output.remoteUrl }} + - title: Open in catalog + icon: catalog -+ entityRef: ${{ steps["register"].output.entityRef }} ++ entityRef: ${{ steps['register'].output.entityRef }} ``` @@ -206,7 +206,7 @@ Alternatively, it's possible to keep the `dash-case` syntax and use brackets for ```yaml input: - repoUrl: ${{ steps["my-custom-action"].output.repoUrl }} + repoUrl: ${{ steps['my-custom-action'].output.repoUrl }} ``` ### Summary diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index d53ce3716c..e5fdb034fb 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -88,17 +88,17 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' # some outputs which are saved along with the job for use in the frontend output: links: - title: Repository - url: ${{ steps["publish"].output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps["register"].output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} ``` Let's dive in and pick apart what each of these sections do and what they are. @@ -505,10 +505,10 @@ The main two that are used are the following: output: links: - title: Repository - url: ${{ steps["publish"].output.remoteUrl }} # link to the remote repository + url: ${{ steps['publish'].output.remoteUrl }} # link to the remote repository - title: Open in catalog icon: catalog - entityRef: ${{ steps["register"].output.entityRef }} # link to the entity that has been ingested to the catalog + entityRef: ${{ steps['register'].output.entityRef }} # link to the entity that has been ingested to the catalog ``` ## The templating syntax diff --git a/packages/create-app/templates/default-app/examples/template/template.yaml b/packages/create-app/templates/default-app/examples/template/template.yaml index 39c5d2326f..be3533162f 100644 --- a/packages/create-app/templates/default-app/examples/template/template.yaml +++ b/packages/create-app/templates/default-app/examples/template/template.yaml @@ -71,4 +71,4 @@ spec: url: ${{ steps["publish"].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps["register"].output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index 642ef25edf..8516139e64 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -129,7 +129,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' - name: Results @@ -141,10 +141,10 @@ spec: output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} ``` You can also visit the `/create/actions` route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like. diff --git a/plugins/scaffolder-backend-module-rails/README.md b/plugins/scaffolder-backend-module-rails/README.md index 9d1316473d..738cd43cff 100644 --- a/plugins/scaffolder-backend-module-rails/README.md +++ b/plugins/scaffolder-backend-module-rails/README.md @@ -206,7 +206,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' - name: Results @@ -218,10 +218,10 @@ spec: output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} ``` ### What you need to run that action diff --git a/plugins/scaffolder-backend-module-yeoman/README.md b/plugins/scaffolder-backend-module-yeoman/README.md index 8ad3a74fe2..5242ef298c 100644 --- a/plugins/scaffolder-backend-module-yeoman/README.md +++ b/plugins/scaffolder-backend-module-yeoman/README.md @@ -126,7 +126,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' - name: Results @@ -138,10 +138,10 @@ spec: output: links: - title: Repository - url: ${{ steps.publish.output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps.register.output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} ``` You can also visit the `/create/actions` route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like. diff --git a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml index 8fd60b594a..074f74f49d 100644 --- a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml @@ -74,7 +74,7 @@ spec: output: links: - title: Repository - url: ${{ steps["publish"].output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog - entityRef: ${{ steps["register"].output.entityRef }} + entityRef: ${{ steps['register'].output.entityRef }} From c0097db1c8168035456177def0da9b94c6c85891 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Wed, 7 Dec 2022 13:21:52 +0000 Subject: [PATCH 4/4] more fixes and changesets Signed-off-by: Brian Fletcher --- .changeset/dirty-ads-refuse.md | 3 +++ .../templates/default-app/examples/template/template.yaml | 4 ++-- .../sample-templates/bitbucket-demo/template.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.changeset/dirty-ads-refuse.md b/.changeset/dirty-ads-refuse.md index 9c982199e7..848800636e 100644 --- a/.changeset/dirty-ads-refuse.md +++ b/.changeset/dirty-ads-refuse.md @@ -1,4 +1,7 @@ --- +'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +'@backstage/plugin-scaffolder-backend-module-yeoman': patch '@backstage/create-app': patch '@backstage/plugin-scaffolder-backend': patch --- diff --git a/packages/create-app/templates/default-app/examples/template/template.yaml b/packages/create-app/templates/default-app/examples/template/template.yaml index be3533162f..33f262b49c 100644 --- a/packages/create-app/templates/default-app/examples/template/template.yaml +++ b/packages/create-app/templates/default-app/examples/template/template.yaml @@ -61,14 +61,14 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' # Outputs are displayed to the user after a successful execution of the template. output: links: - title: Repository - url: ${{ steps["publish"].output.remoteUrl }} + url: ${{ steps['publish'].output.remoteUrl }} - title: Open in catalog icon: catalog entityRef: ${{ steps['register'].output.entityRef }} diff --git a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml index 074f74f49d..ee1bc634b4 100644 --- a/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/bitbucket-demo/template.yaml @@ -68,7 +68,7 @@ spec: name: Register action: catalog:register input: - repoContentsUrl: ${{ steps["publish"].output.repoContentsUrl }} + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} catalogInfoPath: '/catalog-info.yaml' output: