Ansible content linter bot
Currently it's my research about Bots using GitHub Apps integrations. Runs ansible-review
on pull_request
event, posts result via Checks API. One-click installable. Deployed privately for now. Demo of the check posted: https://github.com/webknjaz/ansible-gentoo-laptop/pull/4/checks?check_run_id=26277133
- ansible-review — linter itself
- check-in — Checks API bindings
- CherryPy — framework implementing GitHub webhook event routing, GitHub integration and repos sync via the built-in pubsub bus
- OpenShift — back-end platform
oc new-project ansiwatch-bot
oc new-app --param-file=.env openshift.yaml
# or
cat openshift.yaml | oc process -f - --param-file=.env -o yaml | oc apply -f -
oc start-build ansiwatch-bot
oc rollout latest ansiwatch-bot
- From the
Web Console
homepage, navigate to projectansiwatch-bot
- Click on
Browse > Builds
- Click the link with
BuildConfig
namedansiwatch-bot
- Click the
Configuration
tab - Click the "
Copy to clipboard
" icon to the right of the "GitHub webhook URL
" field - Navigate to your repository on GitHub and click on
repository settings > webhooks > Add webhook
- Paste your webhook URL provided by OpenShift in the "
Payload URL
" field - Change the "
Content type
" to 'application/json
' - Leave the defaults for the remaining fields — that's it!
After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.
Note: adding a webhook requires your OpenShift server to be reachable from GitHub.
Now, whenever you push to that repo it will trigger deployment in OpenShift.
oc logs -f bc/ansiwatch-bot
oc delete all -l app=ansiwatch-bot; oc delete secret ansiwatch-bot