Skip to content

Commit

Permalink
github-jira-proxy, prow, plugin: add plugin that checks github webhooks
Browse files Browse the repository at this point in the history
Signed-off-by: avlitman <alitman@redhat.com>
  • Loading branch information
avlitman committed Jul 11, 2024
1 parent 9a7e357 commit 124a901
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,36 @@ postsubmits:
memory: "8Gi"
securityContext:
privileged: true
- name: publish-github-jira-proxy-image
always_run: false
run_if_changed: "images/github-jira-proxy/.*"
annotations:
testgrid-create-test-group: "false"
decorate: true
cluster: kubevirt-prow-control-plane
max_concurrency: 1
labels:
preset-bazel-cache: "true"
preset-kubevirtci-quay-credential: "true"
preset-podman-in-container-enabled: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240607-febc467
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
- "-c"
- |
cat "$QUAY_PASSWORD" | podman login --username $(cat "$QUAY_USER") --password-stdin=true quay.io
cd images
./publish_image.sh github-jira-proxy quay.io kubevirtci
resources:
requests:
memory: "8Gi"
limits:
memory: "8Gi"
securityContext:
privileged: true
- name: publish-kubevirt-infra-bootstrap-image
always_run: false
run_if_changed: "images/kubevirt-infra-bootstrap/.*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,3 +751,27 @@ presubmits:
resources:
requests:
memory: "100Mi"
- name: build-github-jira-proxy-image
always_run: false
run_if_changed: "images/github-jira-proxy/.*"
decorate: true
labels:
preset-podman-in-container-enabled: "true"
preset-docker-mirror-proxy: "true"
preset-kubevirtci-quay-credential: "true"
cluster: kubevirt-prow-control-plane
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240607-febc467
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
- "-ce"
- "cd images && ./publish_image.sh -b github-jira-proxy quay.io kubevirtci"
securityContext:
privileged: true
resources:
requests:
memory: "2Gi"
limits:
memory: "2Gi"
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ external_plugins:
endpoint: http://referee:9900
events:
- issue_comment
- name: github-jira-proxy
endpoint: http://github-jira-proxy:9900
events:
- pull_request

triggers:
- repos:
Expand Down
2 changes: 2 additions & 0 deletions github/ci/prow-deploy/kustom/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ resources:
- manifests/local/prow-phased-service.yaml
- manifests/local/referee-deployment.yaml
- manifests/local/referee-service.yaml
- manifests/local/github-jira-proxy-deployment.yaml
- manifests/local/github-jira-proxy-service.yaml
- manifests/local/referee-servicemonitor.yaml
- manifests/local/release-blocker_deployment.yaml
- manifests/local/release-blocker_service.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: github-jira-proxy
labels:
app: github-jira-proxy
spec:
replicas: 1
selector:
matchLabels:
app: github-jira-proxy
template:
metadata:
labels:
app: github-jira-proxy
spec:
terminationGracePeriodSeconds: 180
containers:
- name: github-jira-proxy
image: quay.io/kubevirtci/github-jira-proxy:latest
args:
- --dry-run=false
- --port=9900
- --github-token-path=/etc/github/oauth
- --github-endpoint=http://ghproxy
- --github-endpoint=https://api.github.com
ports:
- name: http
containerPort: 9900
volumeMounts:
- name: hmac
mountPath: /etc/webhook
readOnly: true
- name: oauth
mountPath: /etc/github
readOnly: true
- name: plugins
mountPath: /etc/plugins
readOnly: true
- name: cache
mountPath: /var/run/cache
readOnly: false
volumes:
- name: hmac
secret:
secretName: hmac-token
- name: oauth
secret:
secretName: commenter-oauth-token
- name: plugins
configMap:
name: plugins
- name: cache
emptyDir: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Service
metadata:
name: github-jira-proxy
labels:
app: github-jira-proxy
spec:
ports:
- name: default
port: 9900
protocol: TCP
targetPort: 9900
selector:
app: github-jira-proxy
type: ClusterIP
12 changes: 12 additions & 0 deletions images/github-jira-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM docker.io/library/golang:1.21 as builder
WORKDIR /go/src/github.com/kubevirt/project-infra/
RUN mkdir -p /go/src/kubevirt/ && \
cd /go/src/kubevirt/ && \
git clone https://github.com/kubevirt/project-infra.git && \
cd project-infra/ && \
go mod vendor && \
env GOPROXY=off GOFLAGS=-mod=vendor CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/github-jira-proxy ./external-plugins/github-jira-proxy/main.go

FROM gcr.io/k8s-prow/git:latest
COPY --from=builder /go/bin/github-jira-proxy /usr/bin/github-jira-proxy
ENTRYPOINT ["/usr/bin/github-jira-proxy"]

0 comments on commit 124a901

Please sign in to comment.