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
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Link | This issue relates to SONARPLUGINS-1757 [ SONARPLUGINS-1757 ] |
| Fix Version/s | HUDSON-1.9 [ 18259 ] | |
| Description |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
| Fix Version/s | HUDSON-1.8.2 [ 18668 ] | |
| Fix Version/s | HUDSON-1.9 [ 18259 ] | |
| Description |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
| Fix Version/s | HUDSON-1.9 [ 18259 ] | |
| Fix Version/s | HUDSON-1.8.2 [ 18668 ] |
| Assignee | Julien HENRY [ henryju ] |
| Status | Open [ 1 ] | In Progress [ 3 ] |
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
| Assignee | Julien HENRY [ henryju ] | Fabrice Bellingard [ fabemn ] |
| Resolution | Fixed [ 1 ] |
| Original Estimate | 0 minutes [ 0 ] | |
| Remaining Estimate | 0 minutes [ 0 ] | |
| Assignee | Fabrice Bellingard [ fabemn ] | Julien HENRY [ henryju ] |
| Resolution | Fixed [ 1 ] | |
| Status | Resolved [ 5 ] | Reopened [ 4 ] |
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Description |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html: {quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
| Summary | "Skip if environment variable is defined" doesn't work | "Skip if environment variable is defined" doesn't work for environment variable |
| Description |
As reported at http://sonar.15.n6.nabble.com/sonar-dev-Jenkins-Plugin-V1-8-Issue-Environment-Variable-Skip-Sonar-Trigger-td4943409.html:
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
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.
{quote} 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. {quote} I experienced the same issue. Are we using it the wrong way? Is there a workaround? Thanks, Giacomo Boccardo |
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
| Project | Sonar Plugins [ 11911 ] | Sonar Jenkins [ 12930 ] |
| Key | SONARPLUGINS-1886 |
|
| Component/s | Jenkins [ 13726 ] | |
| Fix Version/s | 2.0 [ 19212 ] | |
| Fix Version/s | HUDSON-2.0 [ 18259 ] |
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.