Create a service onboarding pipeline (using IDP Stage)
Create a basic service onboarding pipeline in Harness IDP
This tutorial is designed to help a platform engineer to get started with Harness IDP. We will create a basic service onboarding pipeline that uses a Workflow and provisions an application templated by cookiecutter for a developer. After you create the Workflow, developers can choose the Workflow on the Workflows Overview page and enter details such as a name for the application and the path to their Git repository. The service onboarding pipeline creates a new repository and adds a catalog-info.yaml to it and registers it back into your software catalog all using the new Developer Portal stage.
Users (developers) must perform a sequence of tasks to create the application. First, they interact with a workflow. A workflow is a form that collects a user's requirements. After a user submits the form, IDP executes a Harness pipeline that onboards the new service. Usually the pipeline fetches a cookiecutter template code, creates a new repository, and interacts with third-party providers such as cloud providers, Jira, and Slack.
Before you begin
Before you begin this tutorial, make sure that you have completed the following requirements:
Enable Harness IDP for your account.
Make sure you are assigned the IDP Admin Role or another role that has full access to all IDP resources.
Create a GitHub connector named
democonnectorat the account scope. This connector should be configured for a GitHub organization (personal accounts are currently not supported by this tutorial).
Create a pipeline
Begin by creating a pipeline for onboarding the service.
To create a Developer Portal stage, perform the following steps:
Go to Configure section under IDP, select Projects, and then select a project.
You can also create a new project for the service onboarding pipelines. Eventually, all the users in your account should have permissions to execute the pipelines in this project. For information about creating a project, go to Create organizations and projects.

Then select Create a Pipeline, add a name for the pipeline and select the type as Inline

The YAML below defines an IDP Stage with a number of steps (as described here) that will perform the actions to onboard the new service. Copy the YAML below, then in the Harness Pipeline Studio go to the YAML view and paste below the existing YAML.
Now Save the pipeline.
Create a workflow
Now that our pipeline is ready to execute when a project name and a GitHub repository name are provided, let us create the UI counterpart of it in IDP. Create a workflow.yaml file anywhere in your Git repository. Usually, that would be the same place as your cookiecutter template. We use the react-jsonschema-form playground to build the template. Nunjucks is templating engine for the IDP Workflows.
Replace the YOUR PIPELINE URL HERE with the pipeline URL that you created.

This YAML code is governed by Backstage. You can change the name and description of the Workflow. The Workflow has the following parts:
Input from the user
Execution of pipeline


Let us take a look at the inputs that the Workflow expects from a developer. The inputs are written in the spec.parameters field. It has two parts, but you can combine them. The keys in properties are the unique IDs of fields (for example, github_repo and project_name). If you recall, they are the pipeline variables that we set as runtime inputs earlier. This is what we want the developer to enter when creating their new application.
The YAML definition includes fields such as cloud provider and database choice. They are for demonstration purposes only and are not used in this tutorial.
Authenticate the request to the pipeline
The Workflow contains a single action which is designed to trigger the pipeline you created via an API call. Since the API call requires authentication, Harness has created a custom component to authenticate based of the logged-in user's credentials.
The following YAML snippet under spec.parameters.properties automatically creates a token field without exposing it to the end user.
That token is then used as part of steps as apikey
Register the workflow in IDP
Use the URL to the workflow.yaml created above and register it by using the same process for registering a new software component.
Use the self service workflows
Now navigate to the Workflows page in IDP. You will see the newly created Workflow appear. Click on Choose, fill in the form, click Next Step, then Create to trigger the automated pipeline. Once complete, you should be able to see the new repo created and bootstrapped in your target GitHub organization!
Additional information
Conditional inputs in workflows
One Of: Helps you create a dropdown in the workflow, where only one of all the options available could be selected.
All Of: Helps you create a dropdown in the workflow, where only all the options available could be selected.
Any Of: Helps you to select from multiple properties where both cannot be selected together at once.
For more such references and validate your conditional steps take a look at the react-json schema project.
Upload a file in a workflow
There are 3 types of file upload.
Single File
Multiple Files
Single File with Accept Attribute
Pass an array of inputs to a Harness pipeline
Harness Pipelines variables can only be 3 types, string, number and secrets, in case you want to add multiple strings and comma separated values you need to join them and send as single input parameters.
In the following workflow I want to pick the enum and parse the exampleVar as a string and use it as comma separated value in the inputset for pipeline. As you could see in the example below under inputset, exampleVar takes input as ${{ parameters.exampleVar.join(',') }}.
Unregister/Delete workflow
Navigate to the Catalog page, and select Template under Kind.

Select the Template Name you want to Unregister.
Now on the Template overview page, click on the 3 dots on top right corner and select Unregister Entity.

Now on the Dialog box select Unregister Location.

This will delete the Template.
Last updated
Was this helpful?
