Skip to content

Commit

Permalink
feat: add tidb-ctl trigger (#962)
Browse files Browse the repository at this point in the history
# Why:
- tidb-ctl only build for master branch

---------

Signed-off-by: lijie <[email protected]>
  • Loading branch information
lijie authored Feb 7, 2024
1 parent 4b5d6af commit fb043cc
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/prod/tekton/configs/triggers/triggers/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ resources:
- pingcap/ng-monitoring/git-push.yaml
- pingcap/tidb-binlog/git-create-tag.yaml
- pingcap/tidb-binlog/git-push.yaml
- pingcap/tidb-ctl/git-create-tag.yaml
- pingcap/tidb-ctl/git-push.yaml
- pingcap/tidb-dashboard/fake-git-create-tag.yaml
- pingcap/tidb-dashboard/fake-git-push.yaml
- pingcap/tidb-dashboard/git-create-tag.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: triggers.tekton.dev/v1beta1
kind: Trigger
metadata:
name: tag-create-pingcap-tidb-ctl
labels:
type: github-tag-create
github-owner: pingcap
github-repo: tidb-ctl
spec:
interceptors:
- name: filter on repo owner and name
ref:
name: cel
params:
- name: filter
value: >-
body.repository.owner.login == 'pingcap' && body.repository.name == 'tidb-ctl' && body.ref.matches('^v[0-9]+[.][0-9]+[.][0-9]+')
bindings:
- ref: github-tag-create
- { name: component, value: $(body.repository.name) }
- { name: profile, value: release }
- { name: timeout, value: 1h }
- { name: source-ws-size, value: 10Gi }
- { name: builder-resources-memory, value: 4Gi }
- { name: builder-resources-cpu, value: "2" }
template:
ref: build-component-all-platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: triggers.tekton.dev/v1beta1
kind: Trigger
metadata:
name: git-push-pingcap-tidb-ctl
labels:
type: github-branch-push
github-owner: pingcap
github-repo: tidb-ctl
spec:
interceptors:
- name: filter on repo owner and name
ref:
name: cel
params:
- name: filter
value: >-
body.repository.owner.login == 'pingcap' && body.repository.name == 'tidb-ctl' && body.ref.matches('^refs/heads/(master)$')
bindings:
- ref: github-branch-push
- { name: component, value: $(body.repository.name) }
- { name: profile, value: release }
- { name: timeout, value: 1h }
- { name: source-ws-size, value: 10Gi }
- { name: builder-resources-memory, value: 4Gi }
- { name: builder-resources-cpu, value: "2" }
template:
ref: build-component-all-platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## You should run it firstly:
## kubectl port-forward -n ee-cd svc/el-public 8080

### pingcap/tidb-ctl push on master branch
POST http://127.0.0.1:8080 HTTP/1.1
Accept: */*
content-type: application/json
X-GitHub-Event: push

{
"ref": "refs/heads/master",
"before": "00000000000000000000000000000000000000000",
"after": "9c165585d38e16591d459f21c0c82b9518747aba",
"ref_type": "branch",
"repository": {
"name": "tidb-ctl",
"clone_url": "https://github.com/pingcap/tidb-ctl",
"owner": {
"login": "pingcap"
}
}
}

### pingcap/tidb-ctl version tag created
POST http://127.0.0.1:8080 HTTP/1.1
Accept: */*
content-type: application/json
X-GitHub-Event: create

{
"ref": "v7.5.0",
"ref_type": "tag",
"repository": {
"name": "tidb-ctl",
"clone_url": "https://github.com/pingcap/tidb-ctl.git",
"owner": {
"login": "pingcap"
}
}
}

0 comments on commit fb043cc

Please sign in to comment.