This is GoCD's Notification plugin that updates SCM with build status.
Supported:
- GitHub Pull Request status
- Stash Pull Request status
- Gerrit Change Set status
These plugins require GoCD version >= v15.x or above
Installation:
- Download the latest plugin jar from Releases section. Place it in
<go-server-location>/plugins/external
& restart Go Server.
- Go Server notifies the plugin on every
Stage Status Change
with relevant details. The plugin scans thebuild-cause
to see if thegithub.pr
/stash.pr
/gerrit.cs
material is present. - If it is, then Pull Request/Change Set status is updated with
status=stage-result
,context=pipeline-name/stage-name
&target-url=trackback-url
.
-
You will see
Github Pull Requests status notifier
/Stash Pull Requests status notifier
/Gerrit Change Set status notifier
/GitLab Feature Branch status notifier
on plugin listing page -
You can configure the plugin (this feature requires GoCD version >= v15.2, use system properties to configure the plugin). The details should be as follows:
- Server Base URL The URL of your go-server (by default, http://localhost:8153).
- End Point If using enterprise edition, this needs to be configured for the enterprise endpoint. Else, it can be left blank.
- Username A Github user with push access to the repository.
- Password If not using two factor authentication, this is the password for the given Github user. Else, it can be left blank.
- OAuth Token If using two-factor authentication, provide a personal access token (with the
repo:status
oath scope) instead of the password above. Else, it can be left blank.
Target URL:
- You can provide
trackback
through system propertygo.plugin.build.status.go-server
. It defaults to 'http://localhost:8153' if not available. Eg:
-Dgo.plugin.build.status.go-server=http://localhost:8153
Authentication:
- You can choose to provide
username
&password
through system propertygo.plugin.build.status.github.username
&go.plugin.build.status.github.password
. Eg:
-Dgo.plugin.build.status.github.username=johndoe
-Dgo.plugin.build.status.github.password=thisaintapassword
or provide the oauth access token
through system property go.plugin.build.status.github.oauth
.
-Dgo.plugin.build.status.github.username=johndoe
-Dgo.plugin.build.status.github.oauth=thisaintatoken
- (or) through file
~/.github
on Go Server with the following contents:
login=johndoe
password=thisaintapassword
or
login=johndoe
oauth=thisaintatoken
Github Enterprise:
- You can choose to provide
endpoint
through system propertygo.plugin.build.status.github.endpoint
. Eg:
-Dgo.plugin.build.status.github.endpoint=http://code.yourcompany.com
- (or) through file
~/.github
on Go Server with the following contents:
endpoint=http://code.yourcompany.com
Setup:
- You need to provide
endpoint
,username
&password
through system propertygo.plugin.build.status.stash.endpoint
,go.plugin.build.status.stash.username
&go.plugin.build.status.stash.password
. Eg:
-Dgo.plugin.build.status.stash.endpoint=http://localhost:7990
-Dgo.plugin.build.status.stash.username=johndoe
-Dgo.plugin.build.status.stash.password=thisaintapassword
Setup:
- You need to provide
endpoint
,username
,password
&codeReviewLabel
through system propertygo.plugin.build.status.gerrit.endpoint
,go.plugin.build.status.gerrit.username
,go.plugin.build.status.gerrit.password
,go.plugin.build.status.gerrit.codeReviewLabel
. Eg:
-Dgo.plugin.build.status.gerrit.endpoint=http://localhost:7990
-Dgo.plugin.build.status.gerrit.username=johndoe
-Dgo.plugin.build.status.gerrit.password=thisaintapassword
-Dgo.plugin.build.status.gerrit.codeReviewLabel=Verified
Setup:
- This works with git.fb poller plugin that can be found here https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases
- You will need a Gitlab Oauth token: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
- You need to provide
server_base_url
,endpoint
,oauth_token
using the plugin configuration view - Alternatively you can pass them through GoCD system property
go.plugin.build.status.gitlab.endpoint
,go.plugin.build.status.gitlab.oauth
. Eg:
-Dgo.plugin.build.status.gitlab.endpoint=http://gitlab.com
-Dgo.plugin.build.status.gitlab.oauth=XXXX