https://github.com/vpavlin/jenkins-dreamer
https://github.com/vpavlin/jenkins-dreamer
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vpavlin/jenkins-dreamer
- Owner: vpavlin
- License: mit
- Created: 2017-03-03T15:12:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T10:59:20.000Z (over 7 years ago)
- Last Synced: 2025-01-23T03:45:25.416Z (4 months ago)
- Language: Shell
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jenkins Dreamer
This script is an experimental work to see whether we can get auto-(un)idling for Jenkins on top of OpenShift Pipelines.
It watches builds with type `JenkinsPipeline` and when there is a `New` build, it tries to hit Jenkins URL to wake it up in case it's idled.For the second part, it watches how long it is since last `Finnished`, `Canceled` or `Failed` build and, based on configuration, it idles Jenkins if the
time surpases the given limit.There is an OpenShift template available to run it next to the Jenkins instance on top of OpenShift. It requires some privileges regarding `view` and `edit`
of the project it's running under to follow new builds and to update Jenkins configs for idling.```
oc policy add-role-to-user view system:serviceaccount:${NAMESPACE}:default --namespace ${NAMESPACE}
oc policy add-role-to-user edit system:serviceaccount:${NAMESPACE}:default --namespace ${NAMESPACE}
````#FIXME` use different than default service account!
It's implemented in Bash, so it's quite hacky and it would be best to reimplement in Go as that would enable it to use native libraries for OpenShift client.
Please consult `./dreamer.sh -h` for all the parameters