Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0
-
Labels:None
-
Environment:Jenkins 1.466
Jenkins Sonar Plugin 1.8
-
Number of attachments :
Description
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html it seems the skip only works for variables defined as build parameters but not for environment variables.
We're using the Sonar Jenkins plugin (V1.8 on Jenkins 1.462), and would like to skip Sonar when performing a maven release using the "Skip if environment variable is defined" mechanism.
To do so a variable called "IS_M2RELEASEBUILD" is defined in "Release environment variable" for the sonar configuration and we use that same variable name in the job config within the Sonar advanced field "Skip if environment variable is defined". Even though we're setting the variables Sonar is still being run even when creating a release.
For info, we've used a pre-build shell task with an echo of the IS_M2RELEASEBUILD variable, as well as a post-build shell task; both print "true" for the variable value when doing a release. This behaviour has been observed on both Solaris and Win 7 Jenkins environments.
I experienced the same issue. Are we using it the wrong way? Is there a workaround?
Thanks,
Giacomo Boccardo
Issue Links
- relates to
-
SONARJNKNS-57
Environment Variables not taken into account in "Additional properties" field
-
We are doing something similar here, where we compute the value of SKIP_SONAR variable depending on a number of different criteria. The value is set by the EnvInject plugin and is indeed the right value. However, Sonar keeps executing even though we have configured it to skip running if SKIP_SONAR is set...
The only way this works for us is if SKIP_SONAR is defined as a build parameter. Anything else fails to trigger the expected behavior from Sonar, i.e. to skip it when we don't want it to run. This is obviously not enough.