This was written to bump up the version attribute in sonar property file as part of the CI process.
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-vs-sonar --save-dev
The "grunt-contrib-sonar" task
In your project's Gruntfile, add a section named
sonar to the data object passed into
Copy the sonar property file at the same level as the Gruntfile and run the following command:
For mode is sonar:
> grunt sonar:sonar.properties:patchRunning "sonar:sonar.properties:patch" taskUpdating version in "sonar.properties"
Since this uses semver you can pass the following options major, premajor, minor, preminor, patch, prepatch, or prerelease
read: https://github.com/isaacs/node-semver for more information
For mode is jenkins:
> grunt sonar:sonar.properties:build1234 # where 1234 is the build id, this could come form the jenkins build variableRunning "sonar:sonar.properties:build1234" taskUpdating version in "sonar.properties"
- Add better error handling
- Update the tests so that it actually works