diff --git a/kubernetes/tekton/cloudlog-pr-pipeline-template.yml b/kubernetes/tekton/cloudlog-pr-pipeline-template.yml index 81cec9e..e12f808 100644 --- a/kubernetes/tekton/cloudlog-pr-pipeline-template.yml +++ b/kubernetes/tekton/cloudlog-pr-pipeline-template.yml @@ -14,6 +14,8 @@ spec: default: master - name: short_sha description: Short sha from git commit used to identify binaries + - name: statusURL + description: Tekton dashboard URL for the resource status resourcetemplates: - apiVersion: tekton.dev/v1beta1 kind: PipelineRun @@ -32,6 +34,15 @@ spec: value: $(params.gitCommit) - name: url value: $(params.gitRepositoryURL) + - name: cloudlog-image + resourceSpec: + type: image + params: + - name: url + value: electriccoinco/cloudlog + - name: cloudlog + resourceRef: + name: cloudlog params: - name: shortSha value: $(params.short_sha) @@ -40,4 +51,6 @@ spec: - name: gitCommit value: $(params.gitCommit) - name: gitHubProject - value: $(params.gitHubProject) \ No newline at end of file + value: $(params.gitHubProject) + - name: statusURL + value: $(params.statusURL) \ No newline at end of file diff --git a/kubernetes/tekton/cloudlog-pr-pipeline.yml b/kubernetes/tekton/cloudlog-pr-pipeline.yml index dd9cf41..5578a7f 100644 --- a/kubernetes/tekton/cloudlog-pr-pipeline.yml +++ b/kubernetes/tekton/cloudlog-pr-pipeline.yml @@ -7,10 +7,15 @@ spec: resources: - name: source type: git + - name: cloudlog + type: cloudEvent + - name: cloudlog-image + type: image params: - name: shortSha - name: gitHubProject - name: gitCommit + - name: statusURL tasks: - name: set-status-pending taskRef: @@ -21,7 +26,7 @@ spec: - name: SHA value: $(params.gitCommit) - name: TARGET_URL - value: http://google.com + value: $(params.statusURL) - name: DESCRIPTION value: Attempting to build a binary - name: CONTEXT @@ -51,10 +56,58 @@ spec: - name: SHA value: $(params.gitCommit) - name: TARGET_URL - value: http://google.com + value: $(params.statusURL) - name: DESCRIPTION value: Sucessfully built a binary - name: CONTEXT value: cloudlog-build-binary/check - name: STATE - value: success \ No newline at end of file + value: success + - name: set-docker-status-pending + taskRef: + name: github-set-status + params: + - name: REPO_FULL_NAME + value: $(params.gitHubProject) + - name: SHA + value: $(params.gitCommit) + - name: TARGET_URL + value: $(params.statusURL) + - name: DESCRIPTION + value: Attempting to build a docker image + - name: CONTEXT + value: cloudlog-build-docker-image/check + - name: STATE + value: pending + - name: cloudlog-build-docker-image + runAfter: + - set-docker-status-pending + taskRef: + name: build-docker-image-from-git-source + resources: + inputs: + - name: docker-source + resource: source + outputs: + - name: builtImage + resource: cloudlog-image + - name: notification + resource: cloudlog + - name: set-docker-status-success + runAfter: + - cloudlog-build-docker-image + taskRef: + name: github-set-status + params: + - name: REPO_FULL_NAME + value: $(params.gitHubProject) + - name: SHA + value: $(params.gitCommit) + - name: TARGET_URL + value: $(params.statusURL) + - name: DESCRIPTION + value: Sucessfully built a docker image + - name: CONTEXT + value: cloudlog-build-docker-image/check + - name: STATE + value: success \ No newline at end of file diff --git a/kubernetes/tekton/cloudlog-pr-template.yml b/kubernetes/tekton/cloudlog-pr-template.yml index 1dc5f2d..afc2b0b 100644 --- a/kubernetes/tekton/cloudlog-pr-template.yml +++ b/kubernetes/tekton/cloudlog-pr-template.yml @@ -30,7 +30,7 @@ spec: - name: revision value: $(params.gitCommit) - name: url - value: $(params.gitRepositoryURL) + value: $(params.gitRepositoryURL) params: - name: shortSha value: $(params.short_sha) diff --git a/kubernetes/tekton/cloudlog-pr-triggerbinding.yml b/kubernetes/tekton/cloudlog-pr-triggerbinding.yml index 7a8544c..3e6e661 100644 --- a/kubernetes/tekton/cloudlog-pr-triggerbinding.yml +++ b/kubernetes/tekton/cloudlog-pr-triggerbinding.yml @@ -14,4 +14,6 @@ spec: - name: gitRepositoryURL value: $(body.repository.clone_url) - name: gitHubProject - value: $(body.repository.full_name) \ No newline at end of file + value: $(body.repository.full_name) + - name: statusURL + value: https://tekton-dashboard-prod.z.cash/#/namespaces/default/pipelineruns?labelSelector=tekton.dev%2Fpipeline%3Dcloudlog-pr-pipeline \ No newline at end of file