|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="integrating-bulk-import-with-orchestrator-workflows"] |
| 4 | += Setting up a custom Scaffolder workflow for Bulk Import |
| 5 | + |
| 6 | +As an administrator, you can create a custom Scaffolder template in line with the repository conventions of your organization and add the template into the {product} catalog for use by the Bulk Import plugin on multiple selected repositories. |
| 7 | + |
| 8 | +You can define various custom tasks, including, but not limited to the following: |
| 9 | + |
| 10 | +* Importing existing catalog entities from a repository |
| 11 | +* Creating pull requests for cleanup |
| 12 | +* Calling webhooks for external system integration |
| 13 | + |
| 14 | +.Prerequisites |
| 15 | + |
| 16 | +* You created a custom Scaffolder template for the Bulk Import plugin. |
| 17 | + |
| 18 | +* You have run your {product-very-short} instance with the following environment variable enabled to allow the use of the Scaffolder functionality: |
| 19 | ++ |
| 20 | +[source,yaml] |
| 21 | +---- |
| 22 | +export NODE_OPTIONS=--no-node-snapshot |
| 23 | +---- |
| 24 | + |
| 25 | +.Procedure |
| 26 | + |
| 27 | +* Configure your {my-app-config-file} configuration to instruct the Bulk Import plugin to use your custom template as shown in the following example: |
| 28 | ++ |
| 29 | +[source,yaml] |
| 30 | +---- |
| 31 | +bulkImport: |
| 32 | + importTemplate: <your_template_entity_reference_or_template_name> |
| 33 | + importAPI: `open-pull-requests` | `scaffolder`; |
| 34 | +---- |
| 35 | ++ |
| 36 | +where: |
| 37 | + |
| 38 | +`importTemplate:`:: |
| 39 | +Enter your Scaffolder template entity reference. |
| 40 | + |
| 41 | +`importAPI`:: |
| 42 | +Set the API to 'scaffolder' to trigger the defined workflow for high-fidelity automation. This field defines the import workflow and currently supports two following options: |
| 43 | + |
| 44 | +`open-pull-requests`:: This is the default import workflow, which includes the logic for creating pull requests for every selected repository. |
| 45 | + |
| 46 | +`scaffolder`:: This workflow uses an import scenario defined in the Scaffolder template to create import jobs. Select this option to use the custom import scenario defined in your Scaffolder template. |
| 47 | ++ |
| 48 | +Optional: You can direct the Bulk Import plugin to hand off the entire list of selected repositories to a custom Orchestrator workflow. |
| 49 | ++ |
| 50 | +[IMPORTANT] |
| 51 | +==== |
| 52 | +The Scaffolder template must be generic and not specific to a single repository if you want your custom Scaffolder template to run successfully for every repository in the bulk list. |
| 53 | +==== |
| 54 | + |
| 55 | +.Verification |
| 56 | + |
| 57 | +* The Bulk Import plugin runs the custom Scaffolder template for the list of repositories using the `/task-imports` API endpoint. |
0 commit comments