How do I automatic create github trigger with webhook payhold url via yaml file in openshift?

10/1/2019

I have been trying to get the github payload trigger in openshift since quite some time but doesnt seem to work via yaml file. Basically when I create the pipeline in Openshift via yaml file I want the github trigger to be available as soon as it appears on the dashboard and do not want to run any manual command.

Have appended below text with parameters while creating pipeline but this doesnt work:

triggers:
    - github:
        secretReference: ${GITHUB_WEBHOOK_SECRET}
        secret: ${GITHUB_WEBHOOK_SECRET}
      type: GitHub
    - type: ConfigChange

have also tried putting this in shell :

oc patch bc/testapp --patch "{\"spec\": {\"triggers\": [{\"type\": \"GitHub\",\"github\": {\"secretReference\": {\"name\": \"mysecret\"}}}]}}"

Any one succeeded in doing this ? please help

-- Mayank Gokarna
github
kubernetes
openshift
redhat
yaml

1 Answer

10/1/2019

it should be like below :

triggers:
    - github:
        secretReference: 
          name: ${GITHUB_WEBHOOK_SECRET}
      type: GitHub
-- SairamS
Source: StackOverflow