3
votes

In a regular free style job, I would like to set the build status on every GitHub commit (pending, success, & failure). This is really easy to do with the GitHub plugin. The only catch is that I want to change the context being sent to GitHub. By default, the plugin sends the full project name ('/folder/subfolder/job-name-foo') or the display name if configured in the advanced project properties.

I want the context to be 'continuous-integration/unit-tests' for my unit test jobs and 'continous-integration/style-checks' for the style check jobs. I can't change the display name in all of my jobs to those values because I would have a ton of conflicts. I have several hundred jobs.

I've found a merged PR that adds the functionality to set a custom context, but I can't figure out how to use it!! https://github.com/jenkinsci/github-plugin/pull/100

It uses the token macro plugin which I've never had to explicitly use https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin but I understand how to use it. The problem is that I can't find the right token to overwrite the GitHub context.

So far I've tried:

${displayName='Foo'} ${displayName,foo} ${displayName,var=foo} foo

I've tried about a dozen or more combinations. Anyone else set a custom context?

1

1 Answers

0
votes

This plugin provides a build step to set commit status with different contexts: https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin You can invoke this step with different commit contexts at different stages of build.