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

Some of the Environment Variables are not expanding properly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • xshell-plugin
    • Server in Win 7 and Client also in Win 7, Multi-configuration Project
    • 120.v1307d168def8

      Environment variables are not expanding properly in XSHELL command
      Ex:
      In Xshell, if i give a command as below,

      python test.py "$WORKSPACE/sdkljnkjndj/sdkgjnkdjnbg" "http://idc-ws-isparbs.mchp-main.com:8080/job/$JOB_NAME/$BUILD_NUMBER"

      and if i print the parameters in test.py, I get the following

      '%WORKSPACE\\sdkljnkjndj
      sdkgjnkdjnbg%'
      'http://idc-ws-isparbs.mchp-main.com:8080/job/%JOB_NAME/25%'

      I also get few '%' characters appended to the output

      I was expecting the output as

      'C:\\WS\\sdkljnkjndj
      sdkgjnkdjnbg'
      'http://idc-ws-isparbs.mchp-main.com:8080/job/test_job/25'

          [JENKINS-20478] Some of the Environment Variables are not expanding properly

          I've got the same issue on mac:
          The command I ran:
          echo "mozdownload --type=$BUILD_TYPE --branch=mozilla-aurora --platform=$PLATFORM --locale=$LOCALE --build-id=$BUILD_ID --date=$DATE --retry-attempts=10 --retry-delay=30 --directory=builds"
          The result is:
          mozdownload --type=tinderbox --branch=mozilla-aurora --platform=mac --locale=an --build-id=20140127004003 --date=$DATE --retry-attempts=10 --retry-delay=30 --directory=builds

          Cosmin Malutan added a comment - I've got the same issue on mac: The command I ran: echo "mozdownload --type=$BUILD_TYPE --branch=mozilla-aurora --platform=$PLATFORM --locale=$LOCALE --build-id=$BUILD_ID --date=$DATE --retry-attempts=10 --retry-delay=30 --directory=builds" The result is: mozdownload --type=tinderbox --branch=mozilla-aurora --platform=mac --locale=an --build-id=20140127004003 --date=$DATE --retry-attempts=10 --retry-delay=30 --directory=builds

          Henrik Skupin added a comment -

          I think the last comment might be a different issue because we only see this when the $DATE parameter is empty for the given job.

          Henrik Skupin added a comment - I think the last comment might be a different issue because we only see this when the $DATE parameter is empty for the given job.

          Mark Waite added a comment -

          I think I'm seeing the same issue with my XShell based jobs using a parameterized build.

          The wiki page suggests that the syntax for expansion is to precede the variable with a dollar sign as in $TARGET_URL. When I do that from a parameterized build which has a parameter TARGET_URL, the shell build step correctly expands the TARGET_URL reference, while the XShell build step emits a literal $TARGET_URL.

          Mark Waite added a comment - I think I'm seeing the same issue with my XShell based jobs using a parameterized build. The wiki page suggests that the syntax for expansion is to precede the variable with a dollar sign as in $TARGET_URL. When I do that from a parameterized build which has a parameter TARGET_URL, the shell build step correctly expands the TARGET_URL reference, while the XShell build step emits a literal $TARGET_URL.

          G Harris added a comment -

          Why isn't this fixed 9 months later? Variable parsing is broken and literals are still emitted, which renders it useless for us. Please fix this.

          G Harris added a comment - Why isn't this fixed 9 months later? Variable parsing is broken and literals are still emitted, which renders it useless for us. Please fix this.

          Andrew a added a comment - - edited

          Folks, FYI: I've fixed the issue in my fork of the plugin here: http://github.com/nekromant/xshell-plugin
          I've created the relevant pull request, but it will take someone with proper access rights to actually merge it (The plugin looks quite a bit abandoned, judging by this discussion)

          Andrew a added a comment - - edited Folks, FYI: I've fixed the issue in my fork of the plugin here: http://github.com/nekromant/xshell-plugin I've created the relevant pull request, but it will take someone with proper access rights to actually merge it (The plugin looks quite a bit abandoned, judging by this discussion)

            Unassigned Unassigned
            shankar_ramasamy Shankar R
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: