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

HUDSON_COOKIE variable is not expanded when used inside global env variables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None

      For example we can currently define a global variables as MY_VAR=$WORSPACE/foobar and when we will run the Jenkins job it will contain the correct path.

      Still, if we try to expand the HUDSON_COOKIE variable nothing will happen and we would end-up without any expansion being made

      This is a real issue because it prevents us from implementing a workaround for avoiding SSH session highjacking between multiple builds.

      In order to avoid highjacking we need to be sure that two builds will not share a SSH session by accident. At this moment the only safe way to distinguish between two builds is the HUDSON_COOKIE variable. Other variables are not reliable because they could be too long,
      ANSIBLE_SSH_CONTROL_PATH='%(directory)s/%r@%h:%p.$HUDSON_COOKIE-/home/rhos-ci/jenkins/workspace/foobar'
      ANSIBLE_SSH_CONTROL_PATH_DIR='~/.ssh/'
      The SSH control path is a file socket and its full path is limited to 108 characters, which means that if the expansion would work this could address the issue.

            Unassigned Unassigned
            ssbarnea Sorin Sbarnea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: