Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16754

$JOB_NAME is set to some autogenerated string instead of the project name

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • envinject-plugin
    • None
    • Linux VM

      The parameter JOB_NAME is not set to the project name. Instead it is set to some strange autogenerated string, like jk1-J5537.
      We have quite some plugins loaded in our Jenkins instance. For example we use the EnvInject plugin, that could manipulate that parameter I guess, but I haven't managed to configure it to not change JOB_NAME.

      The BUILD_ID parameter and all others containing the project name are set correctly:
      BUILD_NUMBER=12
      BUILD_TAG=jenkins-environment_variable_test-12
      JOB_NAME=jk1-J5537
      WORKSPACE=/proj/bscautodata/jenkins/ci_prototype/workspace-sge/workspace/environment_variable_test

      Is there a way to see what values those properties have before any plugins, expecially the EnvInject plugin, manipulate them?

      BR,
      Emil

          [JENKINS-16754] $JOB_NAME is set to some autogenerated string instead of the project name

          Emil Bäckmark created issue -

          According to the EnvInject source code, it does not modify the JOB NAME variable.
          Does your WORKSPACE variable value is correct?
          I suggest you should try to isolate the problem.

          Gregory Boissinot added a comment - According to the EnvInject source code, it does not modify the JOB NAME variable. Does your WORKSPACE variable value is correct? I suggest you should try to isolate the problem.

          Yes, the WORKSPACE variable contains the correct JOB_NAME.

          Emil Bäckmark added a comment - Yes, the WORKSPACE variable contains the correct JOB_NAME.

          Could you try to isolate the problem?

          Gregory Boissinot added a comment - Could you try to isolate the problem?

          John McGehee added a comment - - edited

          I see "sge" in your path. Note that Sun Grid Engine also defines variable JOB_NAME, which overwrites the Jenkins JOB_NAME value.

          I work around this by defining.

          export JENKINS_JOB_NAME="$JOB_NAME"

          before qsub.

          See my Jenkins SGE plugin for more information.

          John McGehee added a comment - - edited I see "sge" in your path. Note that Sun Grid Engine also defines variable JOB_NAME , which overwrites the Jenkins JOB_NAME value. I work around this by defining. export JENKINS_JOB_NAME= "$JOB_NAME" before qsub . See my Jenkins SGE plugin for more information.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 147581 ] New: JNJira + In-Review [ 176949 ]

            gbois Gregory Boissinot
            mene Emil Bäckmark
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: