I tried to set up a github webhook to trigger builds on OpenShift following these docs.
I am confused about two things:
(1) When I create the secret, as prescribed by the above docs, do I need to create one YAML entry or two? Ie. are the following snippets (taken from the above link) supposed to be the same YAML entry?
type: "GitHub"
github:
secretReference:
name: "mysecret"
with the second one being:
- kind: Secret
apiVersion: v1
metadata:
name: mysecret
creationTimestamp:
data:
WebHookSecretKey: c2VjcmV0dmFsdWUx
(2) If I query oc describe bc [name-of-my-build-config]
, I get (all masks of [this]
form were added by me)
Webhook GitHub:
URL: https://[blabla].openshift-online.com:6443/apis/build.openshift.io/v1/namespaces/[my-namespace]/buildconfigs/[my-build-config]/webhooks/<secret>/github
So now when I enter this url as a GitHub webhook, what should I replace <secret>
with in the above URL? Also, what should I enter in the textbox for Secret on Github (see screenshot below)
I understand that the WebHookSecretKey: c2VjcmV0dmFsdWUx
is just an encoded version of the plaintext secret key... So where should I use the plaintext key? Should I also use mysecret
anywhere, eg substitute in for <secret>
in the above url?