Skip to content

Commit

Permalink
chore(apps/prod/tekton/configs): update pipeline for artifacts repo (#…
Browse files Browse the repository at this point in the history
…676)

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Sep 2, 2023
1 parent 2322f0a commit 488cb42
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/prod/tekton/configs/pipelines/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- demo.yaml
- pull-pingcap-qe-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions apps/prod/tekton/configs/triggers/triggers/demo.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- demo.yaml
- pull-pingcap-qe-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 488cb42

Please sign in to comment.