From a847a5e5a17f54013311d0cb1c97247e78273af6 Mon Sep 17 00:00:00 2001 From: beppe Date: Fri, 6 Mar 2020 17:14:35 +0100 Subject: [PATCH] HELP --- ...-setup.yaml => github-event-listener.yaml} | 36 ++++++++++++++++++- manifests/github-webhook-setup.yaml | 4 +-- 2 files changed, 37 insertions(+), 3 deletions(-) rename manifests/{github-trigger-setup.yaml => github-event-listener.yaml} (66%) diff --git a/manifests/github-trigger-setup.yaml b/manifests/github-event-listener.yaml similarity index 66% rename from manifests/github-trigger-setup.yaml rename to manifests/github-event-listener.yaml index 9cb0342..8779a00 100644 --- a/manifests/github-trigger-setup.yaml +++ b/manifests/github-event-listener.yaml @@ -51,10 +51,44 @@ apiVersion: tekton.dev/v1alpha1 kind: EventListener metadata: name: github-event-listener + namespace: tekton-pipeline-istio-project-1 spec: serviceAccountName: service-acc triggers: - binding: name: github-trigger-binding template: - name: github-trigger-template \ No newline at end of file + name: github-trigger-template +--- +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: expose-event-listener + namespace: tekton-pipeline-istio-project-1 +spec: + selector: + istio: ingressgateway + servers: + - port: + number: 443 + name: http + protocol: HTTP + hosts: + - "*" +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: link-gateway-listener + namespace: tekton-pipeline-istio-project-1 +spec: + hosts: + - "*" + gateways: + - expose-event-listener + http: + - route: + - destination: + port: + number: 8080 + host: el-github-event-listener \ No newline at end of file diff --git a/manifests/github-webhook-setup.yaml b/manifests/github-webhook-setup.yaml index 4a3e783..6feed67 100644 --- a/manifests/github-webhook-setup.yaml +++ b/manifests/github-webhook-setup.yaml @@ -59,9 +59,9 @@ spec: set -e echo "Create Webhook" if [ $(inputs.params.GitHubDomain) = "github.com" ];then - curl -v -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://api.github.com/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + curl -v -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"https://$(inputs.params.ExternalDomain)\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://api.github.com/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks else - curl -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)/\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://$(inputs.params.GitHubDomain)/api/v3/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + curl -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"https://$(inputs.params.ExternalDomain)/\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://$(inputs.params.GitHubDomain)/api/v3/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks fi --- # https://medium.com/@nikhilthomas1/cloud-native-cicd-on-openshift-with-openshift-pipelines-tektoncd-pipelines-part-3-github-1db6dd8e8ca7