S Stack edited a comment on Bug JENKINS-15507

Reopening/Bug seen in 1.73 - 1.88

  • We've been stuck at EnvInject version 1.72 for the past year.
  • Using SharedObjects 0.44
  • Using Rebuilder 1.20

Simple usage scenario to recreate bug

  • Create a matrix job with one user-defined axis named SERVICE_NAME; values are A B C
    • check : Run each configuration sequentially
  • Rebuild settings
    • check: Prepare an environment for run
    • check: Keep Jenkins env var's
    • check: Keep Jenkins build var's
    • Evaluated Groovy script
      def env = [:]
      if ( SERVICE_NAME == 'C' ) {
         env = ["ADDITIONAL_SETTINGS" : " xyz " ];
      } else {
         env = ["ADDITIONAL_SETTINGS" : "" ];
      }


Results

1.72
  • Each axis job runs successfully
  • Example log for SERVICE_NAME = C
    Started by upstream project "test-JENKINS-15507" build number 1
    originally caused by:
     Started by user sstack
    [EnvInject] - Loading node environment variables.
    [EnvInject] - Preparing an environment for the build.
    [EnvInject] - Keeping Jenkins system variables.
    [EnvInject] - Keeping Jenkins build variables.
    [EnvInject] - Adding build parameters as variables.
    [EnvInject] - Evaluation the following Groovy script content: 
    def env = [:]
    if (SERVICE_NAME == 'C') {
       env = ["ADDITIONAL_SETTINGS" : " xyz "];
    } else {
       env = ["ADDITIONAL_SETTINGS" : ""];
    }
    return env;
    
    [EnvInject] - Injecting contributions.
    Building in workspace /var/opt/jenkins-data/jobs/test-JENKINS-15507/workspace/SERVICE_NAME/C
    [C] $ /usr/bin/env bash /var/tmp/jenkins/hudson8185538443495220535.sh
1.73 and later
  • Parent matrix job fails and thus no axis children jobs are executed.
    Started by user sstack
    [EnvInject] - Loading node environment variables.
    [EnvInject] - Preparing an environment for the build.
    [EnvInject] - Keeping Jenkins system variables.
    [EnvInject] - Keeping Jenkins build variables.
    [EnvInject] - Evaluation the following Groovy script content: 
    def env = [:]
    if (SERVICE_NAME == 'C') {
       env = ["ADDITIONAL_SETTINGS" : " xyz "];
    } else {
       env = ["ADDITIONAL_SETTINGS" : ""];
    }
    return env;
    
    [EnvInject] - [ERROR] - SEVERE ERROR occurs: No such property: SERVICE_NAME for class: Script1
    Finished: FAILURE

    SERVICE_NAME [C]
    ADDITIONAL_SETTINGS [ xyz ]
    Finished: SUCCESS

    
    
  • In the failed job above, the Evaluated Groovy Script doesn't recognize the axis value SERVICE_NAME as an exported property/env var.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to