This service handles post messages created by Atlassian's Post-Receive WebHooks plugin for BitBucket. It only checks the branch delete action and tries to delete the matching project in SonarQube.
It is placed in the config.json
file, like below.
{
"env": "dev",
"port": 3000,
"logDestination": "screen",
"allowedHost": "localhost",
"sonarApiBaseUrl": "http://sonar.boldchat.io/api",
"bitBucketProjectList": [
{
"name": "SmartDesk",
"repositoryMap": [
{
"bitBucket": "test-repo",
"sonarProjectName": "TestRepo",
"sonarProjectKey": "my:repo"
}
]
}
]
}
The port
is where the service listens for HTTP requests.
Logging is color formatted when logDestination
is set to screen
and is plain when set to file
. Default is screen
.
The calls are only accepted from a specific host, that is determined by reverse DNS lookup of the caller IP. The client hostname restricted to allowedHost
.
The mapping bitBucketProjectList
maps the BitBucket projects and the repositories inside it to Sonar project names and keys.
A separate file credential.json
needs to be created on a path where the user running te server process can access it.
The environment variable SONAR_ADMIN_CREDENTIALS
has to point to the location of this file. In case this environment variable is missing, the file is searched at the root of the project.
{
"sonarCredentials": "<PLACE BASIC AUTHORIZATION HEADER HERE>"
}
It is the base64 encoded user:password pair used for HTTP authentication.
This service provides logging for three severities. Only Errors needs to be monitored and taken care of. Log is written to the standard output only.