From fa1704dac6afad20b5beee2c4bbc9ab2b0eb50ae Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 23 Oct 2019 13:11:04 +0100 Subject: [PATCH] Add support for release-postprocessing Add a cloud event pipeline resource to the publish-tekton-pipelines Task. This can be used to trigger post-processing services like log collection and automatic post release testing. Add a resource to the pipeline-release and to the pipeline-release-nightly-triggers pipelines to match the Task one. --- tekton/README.md | 25 +++++++++++++++++++++++-- tekton/publish.yaml | 2 ++ tekton/release-pipeline-nightly.yaml | 4 ++++ tekton/release-pipeline.yaml | 4 ++++ tekton/resources.yaml | 10 ++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/tekton/README.md b/tekton/README.md index fbedda75139..d1d71df1a2d 100644 --- a/tekton/README.md +++ b/tekton/README.md @@ -63,6 +63,26 @@ To use [`tkn`](https://github.com/tektoncd/cli) to run the `publish-tekton-pipel value: revision-for-vX.Y.Z-invalid-tags-boouuhhh # REPLACE with the commit you'd like to build from (not a tag, since that's not created yet) ``` + 1. To use release post-processing services, update the + [`resources.yaml`](./resources.yaml) file to add a valid targetURL in the + cloud event `PipelineResoruce` named `post-release-trigger`: + + ```yaml + apiVersion: tekton.dev/v1alpha1 + kind: PipelineResource + metadata: + name: post-release-trigger + spec: + type: cloudEvent + params: + - name: targetURI + value: http://el-pipeline-release-post-processing.default.svc.cluster.local:8080 # This has to be changed to a valid URL + ``` + + The targetURL should point to the event listener configured in the cluster. + The example above is configured with the correct value for the `dogfooding` + cluster. + 1. To run against your own infrastructure (if you are running [in the production cluster](https://github.com/tektoncd/plumbing#prow) the default account should already have these creds, this is just a bonus - plus @@ -101,7 +121,7 @@ To use [`tkn`](https://github.com/tektoncd/cli) to run the `publish-tekton-pipel tkn pipeline start \ --param=versionTag=${VERSION_TAG} \ - --param=imageRegistry=${IMAGE_REGISTRY} \ + --param=imageRegistry=${IMAGE_REGISTRY} \ --serviceaccount=release-right-meow \ --resource=source-repo=tekton-pipelines-git \ --resource=bucket=tekton-bucket \ @@ -117,7 +137,8 @@ To use [`tkn`](https://github.com/tektoncd/cli) to run the `publish-tekton-pipel --resource=builtWebhookImage=webhook-image \ --resource=builtDigestExporterImage=digest-exporter-image \ --resource=builtPullRequestInitImage=pull-request-init-image \ - --resource=builtGcsFetcherImage=gcs-fetcher-image \ + --resource=builtGcsFetcherImage=gcs-fetcher-image \ + --resource=notification=post-release-trigger pipeline-release ``` diff --git a/tekton/publish.yaml b/tekton/publish.yaml index f1491dd43e1..cbd6a4278c3 100644 --- a/tekton/publish.yaml +++ b/tekton/publish.yaml @@ -47,6 +47,8 @@ spec: type: image - name: builtGcsFetcherImage type: image + - name: notification + type: cloudEvent steps: - name: build-push-base-images diff --git a/tekton/release-pipeline-nightly.yaml b/tekton/release-pipeline-nightly.yaml index 37d23aef5d7..c115052f671 100644 --- a/tekton/release-pipeline-nightly.yaml +++ b/tekton/release-pipeline-nightly.yaml @@ -148,6 +148,8 @@ spec: type: image - name: builtGcsFetcherImage type: image + - name: notification + type: cloudEvent tasks: - name: lint taskRef: @@ -242,3 +244,5 @@ spec: resource: builtPullRequestInitImage - name: builtGcsFetcherImage resource: builtGcsFetcherImage + - name: notification + resource: notification diff --git a/tekton/release-pipeline.yaml b/tekton/release-pipeline.yaml index 3622ee4b185..517aebb7b2c 100644 --- a/tekton/release-pipeline.yaml +++ b/tekton/release-pipeline.yaml @@ -43,6 +43,8 @@ spec: type: image - name: builtGcsFetcherImage type: image + - name: notification + type: cloudEvent tasks: - name: precheck taskRef: @@ -139,3 +141,5 @@ spec: resource: builtPullRequestInitImage - name: builtGcsFetcherImage resource: builtGcsFetcherImage + - name: notification + resource: notification diff --git a/tekton/resources.yaml b/tekton/resources.yaml index 85bb24f45e8..86659479e7d 100644 --- a/tekton/resources.yaml +++ b/tekton/resources.yaml @@ -177,3 +177,13 @@ spec: params: - name: url value: vendor/github.com/googlecloudplatform/cloud-builders/gcs-fetcher/cmd/gcs-fetcher # Registry is provided via parameter, this is a hack see #569 +--- +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: post-release-trigger +spec: + type: cloudEvent + params: + - name: targetURI + value: http://post-release-trigger-sink # This has to be changed to a valid URL