diff --git a/apps/prod/tekton/configs/pipelines/kustomization.yaml b/apps/prod/tekton/configs/pipelines/kustomization.yaml index f0b33e0e7..0b0384d2c 100644 --- a/apps/prod/tekton/configs/pipelines/kustomization.yaml +++ b/apps/prod/tekton/configs/pipelines/kustomization.yaml @@ -5,4 +5,4 @@ resources: - kaniko-build.yaml - codescan-security.yaml - ko-build-test-infra.yaml - - pipeline1.yaml + - pull-pingcap-qe-artifacts-build-image.yaml diff --git a/apps/prod/tekton/configs/pipelines/pipeline1.yaml b/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml similarity index 93% rename from apps/prod/tekton/configs/pipelines/pipeline1.yaml rename to apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml index d59bd6ab4..3a64cddfb 100644 --- a/apps/prod/tekton/configs/pipelines/pipeline1.yaml +++ b/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: - name: demo + name: pull-pingcap-qe-artifacts-build-image spec: workspaces: - name: git-source diff --git a/apps/prod/tekton/configs/triggers/event-listeners/event-listener.yaml b/apps/prod/tekton/configs/triggers/event-listeners/event-listener.yaml index 694a3c3a8..c5753a4b3 100644 --- a/apps/prod/tekton/configs/triggers/event-listeners/event-listener.yaml +++ b/apps/prod/tekton/configs/triggers/event-listeners/event-listener.yaml @@ -21,14 +21,10 @@ spec: value: ["pull_request"] - name: "validate PR state and add field" ref: - name: "cel" + name: cel params: - - name: "filter" - value: "body.action in ['opened', 'synchronize', 'reopened']" - - name: "overlays" - value: - - key: truncated_sha - expression: body.pull_request.head.sha.truncate(7) + - name: filter + value: body.action in ['opened', 'synchronize', 'reopened'] triggerSelector: namespaceSelector: matchNames: diff --git a/apps/prod/tekton/configs/triggers/templates/kustomization.yaml b/apps/prod/tekton/configs/triggers/templates/kustomization.yaml index 37b17c00b..55aa6a1de 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: - - demo.yaml + - pull-pingcap-qe-artifacts.yaml diff --git a/apps/prod/tekton/configs/triggers/templates/demo.yaml b/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml similarity index 88% rename from apps/prod/tekton/configs/triggers/templates/demo.yaml rename to apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml index 7788aa04a..0a7ca4cb6 100644 --- a/apps/prod/tekton/configs/triggers/templates/demo.yaml +++ b/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml @@ -1,7 +1,7 @@ apiVersion: triggers.tekton.dev/v1beta1 kind: TriggerTemplate metadata: - name: github-pr-demo + name: pull-pingcap-qe-artifacts spec: params: - name: git-url @@ -13,7 +13,7 @@ spec: - apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: - generateName: demo-pipeline1-run- + generateName: pull-pingcap-qe-artifacts-build-image-run- annotations: "tekton.dev/git-status": "true" "tekton.dev/status-context": "demo-pipeline1" @@ -23,7 +23,7 @@ spec: "tekton.dev/git-revision": $(tt.params.git-revision) spec: pipelineRef: - name: demo + name: pull-pingcap-qe-artifacts-build-image params: - name: git-url value: $(tt.params.git-url) diff --git a/apps/prod/tekton/configs/triggers/triggers/demo.yaml b/apps/prod/tekton/configs/triggers/triggers/demo.yaml deleted file mode 100644 index e20e23712..000000000 --- a/apps/prod/tekton/configs/triggers/triggers/demo.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: triggers.tekton.dev/v1beta1 -kind: Trigger -metadata: - name: trigger - labels: - type: github-pr -spec: - bindings: - - ref: github-pr - template: - 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 37b17c00b..55aa6a1de 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: - - demo.yaml + - pull-pingcap-qe-artifacts.yaml diff --git a/apps/prod/tekton/configs/triggers/triggers/pull-pingcap-qe-artifacts.yaml b/apps/prod/tekton/configs/triggers/triggers/pull-pingcap-qe-artifacts.yaml new file mode 100644 index 000000000..60be8e797 --- /dev/null +++ b/apps/prod/tekton/configs/triggers/triggers/pull-pingcap-qe-artifacts.yaml @@ -0,0 +1,36 @@ +apiVersion: triggers.tekton.dev/v1beta1 +kind: Trigger +metadata: + name: pull-pingcap-qe-artifacts + labels: + type: github-pr + github-owner: PingCAP-QE + github-repo: artifacts +spec: + interceptors: + - name: filter on repo owner and name + ref: + name: cel + params: + - name: filter + # value: body.repository.name == 'artifacts' + value: >- + body.organization.login == 'PingCAP-QE' && body.repository.name == + 'artifacts' + # - name: add change files to extensions + # ref: + # name: github + # params: + # - name: "addChangedFiles" # TODO: upgrade tekton + # value: + # enabled: true + # - name: execute only when Dockerfile changed + # ref: + # name: cel + # params: + # - name: filter + # value: extensions.changed_files.matches('Dockerfile') + bindings: + - ref: github-pr + template: + ref: pull-pingcap-qe-artifacts