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

Some of the Environment Variables are not expanding properly

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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'

        Attachments

          Activity

          Hide
          cosmin_malutan 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

          Show
          cosmin_malutan 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
          Hide
          whimboo 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.

          Show
          whimboo 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.
          Hide
          markewaite 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.

          Show
          markewaite 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.
          Hide
          g1 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.

          Show
          g1 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.
          Hide
          ncrmnt 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)

          Show
          ncrmnt 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)

            People

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

              Dates

              Created:
              Updated: