-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps/prod/tekton/configs): add new flow to help ci on PRs
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
- Loading branch information
Showing
8 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: ci-helper-for-pr | ||
spec: | ||
description: >- | ||
Create pull request to update version placeholder "README.md" to github repository branch. | ||
params: | ||
- name: owner | ||
description: repo owner | ||
- name: repo | ||
description: repo short name | ||
- name: number | ||
description: pull request number | ||
type: integer | ||
steps: | ||
- name: create-pull-request | ||
image: denoland/deno:1.45.5 | ||
script: | | ||
echo "owner: $(params.owner)" | ||
echo "repo: $(params.repo)" | ||
echo "number: $(params.number)" | ||
workspaces: | ||
- name: github | ||
description: Must includes a key `token` | ||
mountPath: /etc/github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/prod/tekton/configs/triggers/templates/_/ci-helper-for-pr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: triggers.tekton.dev/v1beta1 | ||
kind: TriggerTemplate | ||
metadata: | ||
name: ci-helper-for-pr | ||
spec: | ||
params: | ||
- name: pr-owner | ||
- name: pr-repo | ||
- name: pr-number | ||
type: integer | ||
resourcetemplates: | ||
- apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: ci-helper-for-pr- | ||
spec: | ||
params: | ||
- name: owner | ||
value: $(tt.params.pr-owner) | ||
- name: repo | ||
value: $(tt.params.repo) | ||
- name: number | ||
value: $(tt.params.pr-number) | ||
taskRef: | ||
name: ci-helper-for-pr | ||
workspaces: | ||
- name: github | ||
secret: | ||
secretName: github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
apps/prod/tekton/configs/triggers/triggers/_/github-pr-labeled.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: triggers.tekton.dev/v1beta1 | ||
kind: Trigger | ||
metadata: | ||
name: pr-labeled-with-needs-ok-to-test | ||
labels: | ||
type: github-pr | ||
github-owner: pingcap | ||
spec: | ||
interceptors: | ||
- name: filter on repo owner and name and tags | ||
ref: { name: cel } | ||
params: | ||
- name: filter | ||
value: >- | ||
body.action == 'labeled' | ||
&& | ||
body.label.name in ['needs-ok-to-test'] | ||
&& | ||
body.pull_request.user.login in ['wuhuizuo', 'purlind'] | ||
&& | ||
body.repository.owner.login == 'pingcap' | ||
bindings: | ||
- ref: github-pr | ||
template: | ||
ref: ci-helper-for-pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters