Trigger a Pipeline by Using a Webhook

    This tutorial demonstrates how to trigger a pipeline by using a webhook.

    • You need to create a workspace, a DevOps project, and a user (). This account needs to be invited to the DevOps project and assigned the operator role. See Create Workspaces, Projects, Users and Roles if they are not ready.

    • You need to create a Jenkinsfile-based pipeline from a remote code repository. For more information, see .

    1. Log in to the KubeSphere web console as project-regular. Go to your DevOps project and click a pipeline (for example, jenkins-in-scm) to go to its details page.

    2. Click More and select Edit Settings in the drop-down list.

    1. Log in to GitHub and go to your own repository .

    2. Click Settings, click Webhooks, and click Add webhook.

    3. Enter the webhook push URL of the pipeline for Payload URL and click Add webhook. This tutorial selects Just the push event for demonstration purposes. You can make other settings based on your needs. For more information, see the GitHub document.

    1. On the Code page of your own repository, click master and then select the sonarqube branch.

    2. Go to /deploy/dev-ol/ and click the file devops-sample.yaml.

    3. Click Commit changes at the bottom of the page.

    1. On the Webhooks page of your own repository, click the webhook.

    2. Click Recent Deliveries and click a specific delivery record to view its details.

    1. Log in to the KubeSphere web console as project-regular. Go to your DevOps project and click the pipeline.

    2. On the Run Records tab, check that a new run is triggered by the pull request submitted to the sonarqube branch of the remote repository.