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

$$ collapsed to $ in Pipeline parameter values

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-job-plugin
    • None

      When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

       

      This is the pipeline script

       

      timeout(20) {
          
         node('agent-maven-python') {
      	stage('bash') {
      		sh '''
                      echo $PASS
                      echo ''' + PASS + '''
      	       '''
      	}
         }
      }
      

      This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4

      + echo 'Pass$'
      Pass$
      + echo 'Pass$'
      Pass$
      

       This also affects simple println

      timeout(20) {
          
      node() {
      	stage('Sample bash') {
      	    println env.PASS
      	}
      }
      }
      

          [JENKINS-60724] $$ collapsed to $ in Pipeline parameter values

          Ventseslav Vatashki created issue -
          Ventseslav Vatashki made changes -
          Description Original: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}
           

          This is the output, it is missing the second $ sign. I haven't found other escaped symbols 
          {code:java}
          + echo 'Pass$'
          two$
          + echo 'Pass$'
          two$
          {code}
          New: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}
           

          This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4
          {code:java}
          + echo 'Pass$'
          Pass$
          + echo 'Pass$'
          Pass$
          {code}
          Ventseslav Vatashki made changes -
          Description Original: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}
           

          This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4
          {code:java}
          + echo 'Pass$'
          Pass$
          + echo 'Pass$'
          Pass$
          {code}
          New: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}
           This also affects simple println
          {code:java}
          timeout(20) {
              
          node() {
          stage('Sample bash') {
          println env.PASS
          }
          }
          }
          {code}
          This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4
          {code:java}
          + echo 'Pass$'
          Pass$
          + echo 'Pass$'
          Pass$
          {code}
          Ventseslav Vatashki made changes -
          Description Original: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}
           This also affects simple println
          {code:java}
          timeout(20) {
              
          node() {
          stage('Sample bash') {
          println env.PASS
          }
          }
          }
          {code}
          This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4
          {code:java}
          + echo 'Pass$'
          Pass$
          + echo 'Pass$'
          Pass$
          {code}
          New: When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

           

          This is the pipeline script

           
          {code:java}
          timeout(20) {
              
             node('agent-maven-python') {
          stage('bash') {
          sh '''
                          echo $PASS
                          echo ''' + PASS + '''
          '''
          }
             }
          }
          {code}

          This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4
          {code:java}
          + echo 'Pass$'
          Pass$
          + echo 'Pass$'
          Pass$
          {code}

           This also affects simple println
          {code:java}
          timeout(20) {
              
          node() {
          stage('Sample bash') {
          println env.PASS
          }
          }
          }
          {code}
          Jesse Glick made changes -
          Summary Original: Dollar sign get escaped in Jenkins Password Parameter New: $$ collapsed to $ in Pipeline parameter values
          Jesse Glick made changes -
          Component/s New: workflow-job-plugin [ 21716 ]
          Component/s Original: core [ 15593 ]

          Jesse Glick added a comment -

          Does not seem to be specific to password parameters, just a problem in parameter expansion generally.

          Jesse Glick added a comment - Does not seem to be specific to password parameters, just a problem in parameter expansion generally.

          Jesse Glick added a comment -

          workflow-job #151 includes a minimal self-contained test case.

          Jesse Glick added a comment - workflow-job #151 includes a minimal self-contained test case.
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow-job #151 (Web Link)" [ 24501 ]

            Unassigned Unassigned
            vvatashki Ventseslav Vatashki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: