Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Last active August 29, 2015 14:28
Show Gist options
  • Save jbergstroem/f63fc94def2d0585fe15 to your computer and use it in GitHub Desktop.
Save jbergstroem/f63fc94def2d0585fe15 to your computer and use it in GitHub Desktop.
nodejs jenkins/github notifications

To improve visibility of build status from a PR, we can use the github build status api.

A simple request (for our linter) could look like this:

$ curl -X "POST" \
  -H "Authorization: token ${token}" \
  -d '{"state": "pending", "description": "checking lint status", "context": "linter", "target_url": "${jenkins_url}' https://api.github.com/repos/:nodejs/:node/statuses/${commit_sha}

state is then updated [options: pending, success, failure] whether or not the build succeds or fails. Upon failure [should it be a test] we can provide a link to the tap output.

Security

We need to create a token for all repos we want to update access in. This token needs at least the repo:status oauth scope.

Hooking up to jenkins

The pending/success steps should be part of each (node-test-commit-* and linter) jenkins job description.

Output verbosity/grouping

We can choose to display the results in a few ways, which may or may not be too noisy since we have quite a few runners.

The suggested output would be to show:

  • linter
  • test/arm
  • test/osx
  • test/linux
  • test/windows
  • test/other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment