CodeGuard provides hooks for Atlassian Bitbucket to ensure high-quality code. One hook ensures a successful Jenkins build of unit tests before enabling a merge into configured branches. A second hook automates publishing of artifacts after successful merges into or tagging of selected branches.
- Your Jenkins server must have the git plugin installed
- Your Jenkins server must have a user with read access to Bitbucket server. This can be either a username/password combo or an SSH key.
- Install plugin via Atlassian Marketplace or by building from scratch (below)
- In your Jenkins server, create a user that has read access to Bitbucket server. This can be either a username/password combo or an SSH key.
- Configure the plugin by setting the Jenkins details including base url
(ex.
https://myserver/jenkins), and the username and password the plugin can use to connect to Jenkins. This user will need to have the ability to create and run all jobs. - For each repository, enable the CodeGuard Verify Hook and define a regular expression
that identifies branches that should be verified. For example you can use:
(develop|master)to have CodeGuard verify any pull requests aimed at the develop or master branches. The verification job will run the scriptcodeguard/verify.shthat you define in the root of your repository. - For each repository, enable the CodeGuard Publish Hook and define a regular expression
that identifies branches and tags that should be published. For example you can use:
(develop|master|v(\d)+\.(\d)+\.(\d))to have CodeGuard publish any time code is merged into develop or master or any time a tag is pushed that looks like v1.2.3. The publishing job will run the script:codeguard/publish.shthat you create in the root of your repository.
If you experience any issues or would like to request a new feature, just open a issue on GitHub here https://github.com/capitaltg/codeguard/issues.
./gradlew eclipse- Import project into eclipse
- In the project directory, run
./gradlew buildto generate a jar - In Bitbucket Server, login and go to the "manage add-ons" admin area
- Select the option to upload a plugin
- Configure the plugin
- Fork the repository
- Create your feature branch (
git checkout -b awesome-new-feature) - Commit your changes (
git commit -am 'add awesome feature') - Push to the branch (
git push origin awesome-new-feature) - Create new Pull Request
- Add ability to rerun verification job via Bitbucket
- Ability to customize the verification and publishing script names per repository
CodeGuard is released by Capital Technology Group, LLC under the Apache 2.0 License. See the included LICENSE file for details.
© Capital Technology Group, LLC 2016