-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug-automation: add automation to redeploy on changes in github #42
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,23 @@ | ||
FROM registry.access.redhat.com/ubi8/go-toolset AS builder | ||
ENV CMD=bug-automation | ||
ENV GOPATH=/go | ||
ENV PROJECT=${GOPATH}/src/github.com/openshift/bugzilla-tools/ | ||
ENV CMDBASE=cmd/${CMD}/ | ||
ENV CMDDIR=${PROJECT}/${CMDBASE}/ | ||
|
||
COPY . ${PROJECT} | ||
WORKDIR ${CMDDIR} | ||
RUN make build | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
ENV CMD=bug-automation | ||
ENV GOPATH=/go | ||
ENV PROJECT=${GOPATH}/src/github.com/openshift/bugzilla-tools/ | ||
ENV CMDBASE=cmd/${CMD}/ | ||
ENV CMDDIR=${PROJECT}/${CMDBASE}/ | ||
|
||
RUN microdnf update -y && microdnf clean all | ||
COPY --from=builder ${CMDDIR}/${CMD} /${CMD} | ||
RUN chmod +x /${CMD} | ||
COPY --from=builder ${CMDDIR}/operations/ operations/ | ||
CMD /${CMD} --bugzilla-key=/etc/bugzilla/bugzillaKey |
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
39 changes: 39 additions & 0 deletions
39
cmd/bug-automation/manifests/bug-automation.buildconfig.yml
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,39 @@ | ||
kind: BuildConfig | ||
apiVersion: build.openshift.io/v1 | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-ref: main | ||
app.openshift.io/vcs-uri: 'https://github.com/openshift/bugzilla-tools.git' | ||
name: bug-automation | ||
labels: | ||
app: bug-automation | ||
app.kubernetes.io/component: bug-automation | ||
app.kubernetes.io/instance: bug-automation | ||
app.kubernetes.io/part-of: openshift-bugzilla-tools | ||
spec: | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: 'bug-automation:latest' | ||
strategy: | ||
type: Docker | ||
dockerStrategy: | ||
dockerfilePath: Dockerfiles/Dockerfile.bug-automation | ||
source: | ||
type: Git | ||
git: | ||
uri: 'https://github.com/openshift/bugzilla-tools.git' | ||
ref: main | ||
contextDir: / | ||
triggers: | ||
- type: ConfigChange | ||
resources: | ||
requests: | ||
cpu: '1' | ||
memory: 2G | ||
limits: | ||
cpu: '1.5' | ||
memory: 2G | ||
runPolicy: Serial | ||
successfulBuildsHistoryLimit: 1 | ||
failedBuildsHistoryLimit: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it were me i'd want more history than 1. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
name: bug-automation | ||
labels: | ||
app: bug-automation | ||
app.kubernetes.io/component: bug-automation | ||
app.kubernetes.io/instance: bug-automation | ||
app.kubernetes.io/part-of: openshift-bugzilla-tools |
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
cmd/bug-automation/manifests/git-build-watcher.cronjob.yml
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,50 @@ | ||
kind: CronJob | ||
apiVersion: batch/v1beta1 | ||
metadata: | ||
name: bug-automation-git-build-watcher | ||
annotations: | ||
app.openshift.io/vcs-ref: master | ||
app.openshift.io/vcs-uri: 'https://github.com/openshift/bugzilla-tools.git' | ||
image.openshift.io/triggers: >- | ||
[{"from":{"kind":"ImageStreamTag","name":"git-build-watcher:latest","namespace":"ocp-eng-architects"},"fieldPath":"spec.template.spec.containers[?(@.name==\"bug-automation-git-build-watcher\")].image","pause":"false"}] | ||
labels: | ||
app: bug-automation-git-build-watcher | ||
app.kubernetes.io/component: bug-automation-git-build-watcher | ||
app.kubernetes.io/instance: bug-automation-git-build-watcher | ||
app.kubernetes.io/part-of: openshift-bugzilla-tools | ||
spec: | ||
concurrencyPolicy: Forbid | ||
schedule: '*/5 * * * *' | ||
startingDeadlineSeconds: 3600 | ||
jobTemplate: | ||
metadata: | ||
labels: | ||
app: bug-automation-git-build-watcher | ||
app.kubernetes.io/component: bug-automation-git-build-watcher | ||
app.kubernetes.io/instance: bug-automation-git-build-watcher | ||
app.kubernetes.io/part-of: openshift-bugzilla-tools | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: bug-automation-git-build-watcher | ||
image: image-registry.openshift-image-registry.svc:5000/ocp-eng-architects/git-build-watcher:latest | ||
command: | ||
- /git-build-watcher | ||
- -v=2 | ||
- bug-automation | ||
resources: | ||
requests: | ||
memory: "50Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "50Mi" | ||
cpu: "10m" | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
imagePullPolicy: Always | ||
restartPolicy: OnFailure | ||
serviceAccountName: git-build-watcher | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 1 |
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 @@ | ||
../../../manifests/git-build-watcher.role.yml |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we've generally said there's no good reason to limit your cpu on a pod in general. use whatever the system is willing to give you.
the full core request also seems high.