Circle CI Configuration

 

Pre-requisites

→ Steps to set circleci/config.yml file in CircleCI:

1. Log into CircleCI with your GitHub account.

 

2. Select the Organization where you would be working. The Organizations get populated from your GitHub account.

 

3. Once the Organization is selected, Set Up Project for the “circleci” project.

4. Select the config.yml file that exists in the repository of circleci > main branch and click on the Set Up Project button.

 

Generate tokens for Pipeline triggers

Follow the steps mentioned below to generate a token in CircleCI. Refer to https://circleci.com/docs/managing-api-tokens/#creating-a-personal-api-token for more details.

Steps:

1. Log into CircleCI.

2. Go to User Settings > Personal API Tokens.

3. Click on the Create New Token button.

4. Give the Token Name and click on the Add API Token button.

The API Token is generated. Copy it.

 

 

Construct URL

The following is an example of constructing the URL to trigger a build in CircleCI. Refer to https://circleci.com/docs/api-intro/ for more details.

https://circleci.com/api/v2/project/{project_slug}/pipeline

Where, the Project Slug is <vcs_type>/<org_name>/<repo_name>

The values of the placeholders above:

  • The vcs_type is “gh”

  • The organization name that is created in GitHub and selected in the CircleCI while integration is “qtm4j”

  • The project/repository name that is set as the project while integration is “circleci”

If we replace the placeholders with relevant values for this example, the Project Slug is formed as gh/qtm4j/circleci

Hence, the URL would be -

https://circleci.com/api/v2/project/gh/qtm4j/circleci/pipeline

CI/CD Rule Configuration in QTM4J

 

CI/CD Rule Without Parameters

 

CI/CD Rule With JSON Parameters

 

After creating the CI/CD rule in QTM4J, you can trigger a pipeline job in CircleCI.

The pipeline gets triggered successfully.