From 346e8ab0c928f0c265b1c385b73297fe5bb91104 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Sat, 2 Sep 2023 17:10:09 +0800 Subject: [PATCH] chore(apps/prod/tekton/config): rename tekton resources Signed-off-by: wuhuizuo --- .../tekton/configs/pipelines/pipeline1.yaml | 66 +++---------------- .../templates/{public.yaml => demo.yaml} | 4 +- .../triggers/templates/kustomization.yaml | 2 +- .../triggers/{public.yaml => demo.yaml} | 2 +- .../triggers/triggers/kustomization.yaml | 2 +- 5 files changed, 15 insertions(+), 61 deletions(-) rename apps/prod/tekton/configs/triggers/templates/{public.yaml => demo.yaml} (95%) rename apps/prod/tekton/configs/triggers/triggers/{public.yaml => demo.yaml} (86%) diff --git a/apps/prod/tekton/configs/pipelines/pipeline1.yaml b/apps/prod/tekton/configs/pipelines/pipeline1.yaml index 454739de3..b2211ac1d 100644 --- a/apps/prod/tekton/configs/pipelines/pipeline1.yaml +++ b/apps/prod/tekton/configs/pipelines/pipeline1.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: - name: demo-pipeline1 + name: demo spec: workspaces: - name: git-source @@ -10,30 +10,9 @@ spec: - name: git-revision default: main tasks: - # TODO: using commit-status-tracker to replace explicit tasks. - # https://github.com/tektoncd/experimental/tree/main/commit-status-tracker - - name: set-github-status-start - taskRef: - name: github-set-status - timeout: 1m - params: - - name: git-url - value: $(params.git-url) - - name: sha - value: $(params.git-revision) - - name: description - value: "Build has started" - - name: state - value: pending - - name: context - value: demo-pipeline1 - - name: target-url - value: https://tekton/dashboard/taskrun/log - name: fetch-from-git taskRef: name: git-clone - runAfter: - - set-github-status-start params: - name: url value: $(params.git-url) @@ -42,42 +21,17 @@ spec: workspaces: - name: output workspace: git-source - - name: go-build - taskRef: - name: golang-build - runAfter: - - fetch-from-git - workspaces: - - name: source - workspace: git-source - params: - - name: packages - value: ./... - - name: go-test - taskRef: - name: golang-test + - name: hello + taskSpec: + steps: + - name: echo + image: debian:latest + script: | + pwd + df -h + echo hello runAfter: - fetch-from-git workspaces: - name: source workspace: git-source - params: - - name: packages - value: ./... - finally: - - name: set-github-status-end - taskRef: - name: github-set-status - params: - - name: git-url - value: $(params.git-url) - - name: sha - value: $(params.git-revision) - - name: description - value: "Build has finished" - - name: state - value: success - - name: context - value: demo-pipeline1 - - name: target-url - value: https://tekton/dashboard/taskrun/log diff --git a/apps/prod/tekton/configs/triggers/templates/public.yaml b/apps/prod/tekton/configs/triggers/templates/demo.yaml similarity index 95% rename from apps/prod/tekton/configs/triggers/templates/public.yaml rename to apps/prod/tekton/configs/triggers/templates/demo.yaml index 612464fab..7788aa04a 100644 --- a/apps/prod/tekton/configs/triggers/templates/public.yaml +++ b/apps/prod/tekton/configs/triggers/templates/demo.yaml @@ -1,7 +1,7 @@ apiVersion: triggers.tekton.dev/v1beta1 kind: TriggerTemplate metadata: - name: github-pr-public + name: github-pr-demo spec: params: - name: git-url @@ -23,7 +23,7 @@ spec: "tekton.dev/git-revision": $(tt.params.git-revision) spec: pipelineRef: - name: demo-pipeline1 + name: demo params: - name: git-url value: $(tt.params.git-url) diff --git a/apps/prod/tekton/configs/triggers/templates/kustomization.yaml b/apps/prod/tekton/configs/triggers/templates/kustomization.yaml index 77c4bf7ec..37b17c00b 100644 --- a/apps/prod/tekton/configs/triggers/templates/kustomization.yaml +++ b/apps/prod/tekton/configs/triggers/templates/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - public.yaml + - demo.yaml diff --git a/apps/prod/tekton/configs/triggers/triggers/public.yaml b/apps/prod/tekton/configs/triggers/triggers/demo.yaml similarity index 86% rename from apps/prod/tekton/configs/triggers/triggers/public.yaml rename to apps/prod/tekton/configs/triggers/triggers/demo.yaml index d544be342..e20e23712 100644 --- a/apps/prod/tekton/configs/triggers/triggers/public.yaml +++ b/apps/prod/tekton/configs/triggers/triggers/demo.yaml @@ -8,4 +8,4 @@ spec: bindings: - ref: github-pr template: - ref: github-pr-public + ref: github-pr-demo diff --git a/apps/prod/tekton/configs/triggers/triggers/kustomization.yaml b/apps/prod/tekton/configs/triggers/triggers/kustomization.yaml index 77c4bf7ec..37b17c00b 100644 --- a/apps/prod/tekton/configs/triggers/triggers/kustomization.yaml +++ b/apps/prod/tekton/configs/triggers/triggers/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - public.yaml + - demo.yaml