Chapter 3. Configuring GitLab Webhooks for automated pipeline triggers
Learn how to set up webhooks and secrets in GitLab to automatically trigger pipeline run in RHDH upon code updates.
Prerequisites
- You have an existing GitLab project.
- You have administrator privileges on OpenShift web console.
Procedure
Retrieve Webhook URL and Secret Token:
- Log in to the OpenShift web console with Administrator privileges.
-
Navigate to the
rhtap
project, expand Pipelines, and then select PipelineRuns. -
Locate the
rhtap-pe-info-<>
pipeline run, and then select the Logs tab.
NoteThese logs contain the webhook URL and secret token required for GitLab configuration.
Configure Webhook in GitLab:
- Within your GitLab repository, navigate to Settings > Webhooks.
- In the URL field, enter the webhook URL copied from Step 1.
- In the Secret Token field, enter the secret token copied from Step 1.
In the Trigger section:
- Select Push events.
- Select Merge request events.
- Click Add Webhook.
Verification
- Push your code changes to the GitLab repository.
- Navigate to the CI tab in RHDH.
- Verify that a pipeline run is triggered for your code push.
Revised on 2024-07-15 21:00:30 UTC