|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="procedure-bulk-import-scaffolder-template"] |
| 4 | += Understanding Bulk Import Scaffolder template input parameters |
| 5 | + |
| 6 | +You can use the Bulk Import plugin to run a Scaffolder template task with specified parameters. As an administrator, you must use these parameters within the template. |
| 7 | + |
| 8 | +The Bulk Import plugin analyzes Git repository information and provides the following parameters for the Scaffolder template task: |
| 9 | + |
| 10 | +`repoUrl`:: Normalized repository URL in the following format: |
| 11 | ++ |
| 12 | +[source,yaml] |
| 13 | +---- |
| 14 | + ${gitProviderHost}?owner=${owner}&repo=${repository-name} |
| 15 | +---- |
| 16 | ++ |
| 17 | +For example, when you run the process, the plugin transforms `https://github.com/redhat-developer/rhdh-plugins` into `github.com?owner=redhat-developer&repo=rhdh-plugins`. |
| 18 | + |
| 19 | +`name`:: The repository name. |
| 20 | ++ |
| 21 | +For example, for `https://github.com/redhat-developer/rhdh-plugins`, the `name` is `rhdh-plugins`. |
| 22 | + |
| 23 | +`organization`:: The repository owner, which can be a user nickname or organization name. |
| 24 | ++ |
| 25 | +For example, for `https://github.com/redhat-developer/rhdh-plugins`, the `organization` is `redhat-developer`. |
| 26 | + |
| 27 | +`branchName`:: The proposed repository branch. By default, the proposed repository branch is `bulk-import-catalog-entity`. |
| 28 | + |
| 29 | +`targetBranchName`:: The default branch of the Git repository. |
| 30 | + |
| 31 | +`gitProviderHost`:: The Git provider host parsed from the repository URL. |
| 32 | ++ |
| 33 | +For example, for `https://github.com/redhat-developer/rhdh-plugins`, the `gitProviderHost` is `github.com`. You can use this parameter to write `Git-provider-agnostic` templates. |
| 34 | + |
| 35 | +To use parameters in a Scaffolder template: |
| 36 | +[source,yaml] |
| 37 | +---- |
| 38 | +parameters: |
| 39 | + - title: Repository Details |
| 40 | + required: |
| 41 | + - repoUrl |
| 42 | + - branchName |
| 43 | + - targetBranchName |
| 44 | + - name |
| 45 | + - organization |
| 46 | + properties: |
| 47 | + repoUrl: |
| 48 | + type: string |
| 49 | + title: Repository URL (Backstage format) |
| 50 | + description: `github.com?owner=Org&repo=repoName` | `gitlab.com?owner=Org&repo=repoName` |
| 51 | + organization: |
| 52 | + type: string |
| 53 | + title: Owner of the Repository |
| 54 | + name: |
| 55 | + type: string |
| 56 | + title: Name of the repository |
| 57 | + branchName: |
| 58 | + type: string |
| 59 | + title: Branch to add the catalog entity to |
| 60 | + targetBranchName: |
| 61 | + type: string |
| 62 | + title: Branch to target the PR/MR to |
| 63 | + gitProviderHost: |
| 64 | + type: string |
| 65 | + title: Git provider host |
| 66 | +---- |
0 commit comments