Skip to content

Commit

Permalink
📂 Update openshift specific files.
Browse files Browse the repository at this point in the history
  • Loading branch information
concaf committed Nov 24, 2021
1 parent 856758b commit bbdf9f6
Show file tree
Hide file tree
Showing 78 changed files with 7,899 additions and 24 deletions.
83 changes: 83 additions & 0 deletions .tekton/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: tektoncd-operator-run-on-pr
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-target-branch: "[release-next]"
pipelinesascode.tekton.dev/task: "[git-clone, golang-test]"
spec:
params:
- name: repo_url
value: {{repo_url}}
- name: revision
value: {{revision}}
pipelineSpec:
params:
- name: repo_url
- name: revision
tasks:
- name: fetch
taskRef:
name: git-clone
params:
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.revision)
workspaces:
- name: output
workspace: source
- name: test
runAfter: [fetch]
taskRef:
name: golang-test
params:
- name: package
value: "github.com/openshift/tektoncd-operator"
workspaces:
- name: source
workspace: source
finally:
- name: finally
taskSpec:
steps:
- name: send-to-slack
env:
- name: SLACK_WEBHOOK_URL
valueFrom:
secretKeyRef:
name: slack-tektoncd-operator-ci-webhook
key: hook_url
- name: PIPELINERUN
valueFrom:
fieldRef:
fieldPath: metadata.labels['tekton.dev/pipelineRun']
- name: GITHUB_PULL_LABEL
value: "{{pull_request.labels}}"
- name: LABEL_TO_CHECK
value: "nightly-ci"
- name: SUCCESS_URL_ICON
value: "https://github.com/tektoncd.png"
- name: FAILURE_URL_ICON
value: "https://user-images.githubusercontent.com/4288561/114842214-eecf6c80-9dd8-11eb-8924-86288b1a501c.jpeg"
- name: SUCCESS_SUBJECT
value: "Tektoncd Operator CI ran successfull on {{pull_request.html_url}} :pipelines: :dance_cat: :yay2:"
- name: FAILURE_SUBJECT
value: "Tektoncd Operator CI has failed on {{pull_request.html_url}} :pipeline: :sadparrot: :failed:"
- name: LOG_URL
value: "{{openshift_console_pipelinerun_href}}"

image: quay.io/chmouel/tekton-asa-code:latest
command: ["/code/misc/send-slack-notifications.py"]

workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
12 changes: 3 additions & 9 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# The OWNERS file is used by prow to automatically merge approved PRs.

approvers:
- vdemeester
- sthaha
- nikhil-thomas
- savitaashture
- houshengbo
- vincent-pli
- tektoncd-approvers

reviewers:
- pradeepitm12
- piyush-garg
- sm43
- tektoncd-reviewers
19 changes: 19 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
aliases:
tektoncd-approvers:
- vdemeester
- sthaha
- hrishin
- chmouel
- nikhil-thomas
tektoncd-reviewers:
- mgencur
- jcrossley3
- vdemeester
- arilivigni
- chmouel
- sthaha
- hrishin
- piyush-garg
- pradeepitm12
- rupalibehera
- sm43
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: bitbucket-pullreq
spec:
params:
- name: gitrepo-url
value: $(body.pullRequest.fromRef.repository.links.clone[0].href)
- name: pullreq-sha
value: $(body.pullRequest.fromRef.latestCommit)
- name: pullreq-state
value: $(body.pullRequest.state)
- name: pullreq-number
value: $(body.pullRequest.id)
- name: pullreq-repo-name
value: $(body.pullRequest.toRef.repository.name)
- name: pullreq-html-url
value: $(body.pullRequest.links.self[0].href)
- name: pullreq-title
value: $(body.pullRequest.title)
- name: user-type
value: $(body.pullRequest.author.user.type)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: bitbucket-push
spec:
params:
- name: git-revision
value: $(body.changes[0].ref.displayId)
- name: gitrepo-url
value: $(body.repository.links.clone[0].href)
- name: git-repo-name
value: $(body.repository.name)
- name: pusher-name
value: $(body.actor.name)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: bitbucket-pullreq-add-comment
spec:
params:
- name: comment
value: $(body.comment.text)
- name: comment-user-login
value: $(body.comment.author.name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
name: tekton-clustertriggerbindings-view
rules:
- apiGroups:
- triggers.tekton.dev
resources:
- clustertriggerbindings
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tekton-clustertriggerbindings-view-auth
roleRef:
kind: ClusterRole
name: tekton-clustertriggerbindings-view
apiGroup: rbac.authorization.k8s.io
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:authenticated
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: github-pullreq
spec:
params:
- name: git-repo-url
value: $(body.repository.html_url)
- name: pullreq-sha
value: $(body.pull_request.head.sha)
- name: pullreq-action
value: $(body.action)
- name: pullreq-number
value: $(body.number)
- name: pullreq-repo-full_name
value: $(body.repository.full_name)
- name: pullreq-html-url
value: $(body.pull_request.html_url)
- name: pullreq-title
value: $(body.pull_request.title)
- name: pullreq-issue-url
value: $(body.pull_request.issue_url)
- name: organisations-url
value: $(body.pull_request.user.organizations_url)
- name: user-type
value: $(body.pull_request.user.type)


---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: github-push
spec:
params:
- name: git-revision
value: $(body.head_commit.id)
- name: git-commit-message
value: $(body.head_commit.message)
- name: git-repo-url
value: $(body.repository.url)
- name: git-repo-name
value: $(body.repository.name)
- name: content-type
value: $(header.Content-Type)
- name: pusher-name
value: $(body.pusher.name)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: github-pullreq-review-comment
spec:
params:
- name: comment
value: $(body.comment.body)
- name: comment-user-login
value: $(body.comment.user.login)
- name: merge-commit-sha
value: $(body.pull_request.merge_commit_sha)
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# pull/merge_request event https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#merge-request-events
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-mergereq
spec:
params:
- name: git-repo-url
value: $(body.project.git_http_url)
- name: mergereq-sha
value: $(body.object_attributes.last_commit.id)
- name: mergereq-action
value: $(body.object_attributes.action)
- name: mergereq-number
value: $(body.object_attributes.iid)
- name: mergereq-repo-name
value: $(body.repository.name)
- name: mergereq-url
value: $(body.object_attributes.url)
- name: mergereq-title
value: $(body.object_attributes.title)

# push events https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#push-events
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-push
spec:
params:
- name: git-revision
value: $(body.checkout_sha)
- name: git-commit-message
value: $(body.commits[0].message)
- name: git-repo-url
value: $(body.repository.git_http_url)
- name: git-repo-name
value: $(body.repository.name)
- name: pusher-name
value: $(body.user_name)

# comment events are done at commit, merge_request, issue and code snippet for more info https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#comment-events
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-review-comment-on-issues
spec:
params:
- name: issue-url
value: $(body.issue.url)
- name: issue-title
value: $(body.issue.title)
- name: issue-comment-link
value: $(body.object_attributes.url)
- name: issue-owner
value: $(body.user.name)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-review-comment-on-mergerequest
spec:
params:
- name: mergereq-url
value: $(body.merge_request.url)
- name: comment-description
value: $(body.object_attributes.description)
- name: comment-url
value: $(body.object_attributes.url)
- name: mr-owner
value: $(body.user.name)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-review-comment-on-commit
spec:
params:
- name: commit-url
value: $(body.commit.url)
- name: comment-description
value: $(body.object_attributes.description)
- name: comment-url
value: $(body.object_attributes.url)
- name: commit-owner
value: $(body.user.name)

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: gitlab-review-comment-on-snippet
spec:
params:
- name: snippet-comment-description
value: $(body.object_attributes.description)
- name: snippet-comment-url
value: $(body.object_attributes.url)
- name: snippet-title
value: $(body.snippet.title)
- name: snippet-type
value: $(body.snippet.type)
- name: snippet-owner
value: $(body.user.name)
Loading

0 comments on commit bbdf9f6

Please sign in to comment.