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

Can't use environment variables like JENKINS_URL、JOB_URL、BUILD_URL in a new jenkins before it's save-button which is in system settings is clicked

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • Jenkins ver. 1.592

      when I start to use a new Jenkins, some environment variables like JENKINS_URL、JOB_URL、BUILD_URL can't be used.But when I click the save-button in system settings ,those environment variables works.So i doubt is it right?

          [JENKINS-28466] Can't use environment variables like JENKINS_URL、JOB_URL、BUILD_URL in a new jenkins before it's save-button which is in system settings is clicked

          liu yecheng created issue -
          liu yecheng made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          liu yecheng made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          liu yecheng made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          liu yecheng made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Daniel Beck made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: build-environment-plugin [ 17667 ]
          Daniel Beck made changes -
          Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]

          Alex Earl added a comment -

          Jenkins currently looks at the explicitly configured location information, and if that doesn't exist, it tries to use the current StaplerRequest. In the case of a job using the variables, there is no StaplerRequest, so there is no fallback to getting this information.

          Alex Earl added a comment - Jenkins currently looks at the explicitly configured location information, and if that doesn't exist, it tries to use the current StaplerRequest. In the case of a job using the variables, there is no StaplerRequest, so there is no fallback to getting this information.

          Javier Palacios added a comment - - edited

          I've also hit this issue. My case is running acceptance checks for the gitlab-hook plugin. The plugin submits the url to gitlab to be stored there, and it is one of the things I want to verify on acceptance tests.
          I run them on TravisCI, and the only BUILD_* variables that are set there are
          BUILD_DISPLAY_NAME='#1'
          BUILD_ID='1'
          BUILD_NUMBER='1'
          BUILD_TAG='jenkins-multiscm_master-1'

          Edit: most of the projects are created by the plugin from other projects, and the config.xml I setup before firing the jenkins instance can be seen at github repo

          Javier Palacios added a comment - - edited I've also hit this issue. My case is running acceptance checks for the gitlab-hook plugin. The plugin submits the url to gitlab to be stored there, and it is one of the things I want to verify on acceptance tests. I run them on TravisCI, and the only BUILD_* variables that are set there are BUILD_DISPLAY_NAME='#1' BUILD_ID='1' BUILD_NUMBER='1' BUILD_TAG='jenkins-multiscm_master-1' Edit: most of the projects are created by the plugin from other projects, and the config.xml I setup before firing the jenkins instance can be seen at github repo
          Javier Palacios made changes -
          Environment Original: Jenkins ver. 1.592 New: Jenkins ver. 1.592 1.625.3LTS

            Unassigned Unassigned
            hz_tc liu yecheng
            Votes:
            3 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: