Configuring GitHub WebHooks
Now we need to configure webhook-url on backend and frontend source code repositories with the Route we exposed in the previously.
Run below command to get webhook-url
Note:
Fork the backend and frontend source code repositories so that you have sufficient privileges to configure GitHub webhooks.
Configure webhook manually
Open forked github repo (Go to Settings > Webhook) click on Add Webhook
> Add
to payload URL > Select Content type as application/json
> Add secret eg: 1234567
> Click on Add Webhook
Follow above procedure to configure webhook on frontend repo
Now we should see a webhook configured on your forked source code repositories (on our GitHub Repo, go to Settings>Webhooks).
Great!, We have configured webhooks
Trigger pipeline Run
When we perform any push event on the backend the following should happen.
The configured webhook in vote-api GitHub repository should push the event payload to our route (exposed EventListener Service).
The Event-Listner will pass the event to the TriggerBinding and TriggerTemplate pair.
TriggerBinding will extract parameters needed for rendering the TriggerTemplate. Successful rendering of TriggerTemplate should create 2 PipelineResources (source-repo-vote-api and image-source-vote-api) and a PipelineRun (build-deploy-vote-api)
We can test this by pushing a commit to vote-api repository from GitHub web ui or from terminal.
Let’s push an empty commit to vote-api repository.
Watch OpenShift WebConsole Developer perspective and a PipelineRun will be automatically created.
Last updated