2

I have a working Tekton Pipeline that is successfully triggered by a GitHub webhook, but it doesn't work with Gitlab webhook. I can see that the Gitlab webhook is triggered and that it gets to the EventListener container in OpenShift, but the Pipeline itself does not run. So, does it work with Gitlab webhooks? If so, is there something that I need to setup or change so that it actually triggers the pipeline?

Thanks! Cesar

Cesar Ida
  • 21
  • 2
  • Have a look into the `EventListener` pods logs. I had some cases where the `json` payload send was malformed or couldn't be parsed. Also I had an incorrect `PipelineRun` definition inside my `TriggerTemplate`. Can you provide code examples and the `EventListener` pod logs? – jonashackt Nov 30 '21 at 13:25
  • I also wrote about [a fully working example of GitLab Tekton Integration using Tekton Triggers, GitLab Webhook and the gitlab-set-status Task in this so Q&A](https://stackoverflow.com/questions/70156006/report-tekton-pipeline-status-to-gitlab-regardless-if-pipeline-failed-or-succeed). Here's the fully comprehensible example project if your interested: https://github.com/jonashackt/aws-eks-tekton-gitlab/ – jonashackt Nov 30 '21 at 13:27

1 Answers1

1

A Tekton Trigger can initiated by any http-request, so if you use a GitHub-webhook, a GitLab webhook or a curl command should not matter.

However, those webhook requests provide data in a slightly different json-format, so to pass parameters to the Pipeline, you need to properly configure the TriggerBinding matching the request that you receive. You probably need a different TriggerBinding for GitLab than for GitHub.

but the Pipeline itself does not run

it is hard to answer this part without more information. Any error message?

Jonas
  • 121,568
  • 97
  • 310
  • 388
  • Thank you Jonas! I don't see errors in any of the containers logs (tekton-triggers-webhook, tekton-triggers-controller, tekton-pipelines-controller, tekton-pipelines-webhook). Is there somewhere else that I should look for? – Cesar Ida Oct 21 '20 at 13:49
  • Yeah, you should have a look into the `EventListener` pod's logs. Grab the name via `kubectl get pods` (it's derived from the contents of your `EventListener`'s `metadata: name:` field prefixed by `el-`). Assuming this gives a `el-gitlab-listener-db6bb5858-dc8ks 1/1 Running 0 17m`, then you can grab the logs via `k logs po el-gitlab-listener-db6bb5858-dc8ks`. – jonashackt Nov 30 '21 at 13:23