Skip to content

Commit

Permalink
feat(apps/prod/tekton/configs/triggers): fix trigger resources (#752)
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Nov 2, 2023
1 parent 51f1e54 commit 45f04f1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
- name: git-revision
value: $(body.after)
- name: git-ref
value: $(body.ref.substringAfter('refs/heads/')) # "refs/heads/main" => "main"
value: $(extensions.short-ref)
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ spec:
params:
- name: eventTypes
value: ["push"]
- name: "validate branch push"
# "refs/heads/main" => "main"
- name: shortten the git REF
ref:
name: cel
params:
- name: filter
value: body.ref_type == 'branch'
- name: overlays
value:
- key: short-ref
expression: body.ref.replace('refs/heads/', '')
triggerSelector:
namespaceSelector:
matchNames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
taskRef:
kind: Task
name: git-clone
- name: build-RC
- name: build-rc
taskSpec:
metadata: {}
spec: null
Expand Down
25 changes: 25 additions & 0 deletions apps/prod/tekton/configs/triggers/test.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## You should run it firstly:
## kubectl port-forward -n ee-cd svc/el-trigger-groups-listener 8080

### tikv/pd: 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": "a1a1eea8dafd7918d583378790a4bb6c39a21f97",
"after": "01fb56b4f1eb0313e41c25ef08c1b543bd153d0e",
"ref_type": "branch",
"repository": {
"name": "pd",
"clone_url": "https://github.com/tikv/pd.git",
"owner": {
"login": "tikv"
}
}
}

### tikv/pd: create version tag
## WIP

0 comments on commit 45f04f1

Please sign in to comment.