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

Unable to see the error for shell script

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: _unsorted
    • Labels:
      None
    • Similar Issues:

      Description

       stage('Docker Publish to Registry') {
      steps {
      echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
      script {
      def passwordMask = [
      $class: 'MaskPasswordsBuildWrapper',
      varPasswordPairs: [[
      password: secrets.dtrToken
      ]]
      ]
      wrap(passwordMask) {
      sh """
      docker login --username ${secrets.dtrUsername} --password \"${secrets.dtrToken}\" ${dockerRegistry}
      statusCode=\$(curl -X POST -u ${secrets.dtrUsername}:${secrets.dtrToken} -H "Content-Type: application/json" -d '${JsonOutput.toJson(createRepoRequest)}' -o -I -L -s -w "%{http_code}" ${createRepoApi})
      if [ "\$statusCode" = '201' ]
      then
      echo 'Created docker repository with appropriate permissions.'
      else
      echo 'Create docker repository manually since auto create was not successful.'
      fi
      """
      dockerImage.push();
      }
      }
      }
      }
       Above is the stage I am trying to execute in my jenkins file.
       its only printing below line and stopped in console output.
       echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
       
       And its not printing  sh """docker login --username
       anything from this line 
       
       

       
       
       
       
       
       
       
       
      Send a message
       
       

        Attachments

          Activity

          adilm Adil created issue -
          adilm Adil made changes -
          Field Original Value New Value
          Description  stage('Docker Publish to Registry') {
          steps {
          echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
          script {
          def passwordMask = [
          $class: 'MaskPasswordsBuildWrapper',
          varPasswordPairs: [[
          password: secrets.dtrToken
          ]]
          ]
          wrap(passwordMask) {
          sh """
          docker login --username ${secrets.dtrUsername} --password \"${secrets.dtrToken}\" ${dockerRegistry}
          statusCode=\$(curl -X POST -u ${secrets.dtrUsername}:${secrets.dtrToken} -H "Content-Type: application/json" -d '${JsonOutput.toJson(createRepoRequest)}' -o -I -L -s -w "%\{http_code}" ${createRepoApi})
          if [ "\$statusCode" = '201' ]
          then
          echo 'Created docker repository with appropriate permissions.'
          else
          echo 'Create docker repository manually since auto create was not successful.'
          fi
          """
          dockerImage.push();
          }
          }
          }
          }
           Above is the stage I am trying to execute in my jenkins file.
           its only printing below line and stopped in console output.
           echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
           
           And its not printing  sh """docker login --username
           anything from this line 
           
           
          !https://lh3.googleusercontent.com/a/AATXAJxXq_qH7RrSfHARRUj8_ue6z2PzWoPZTtMG1PAn=s24-c-k-no-mo!
           
           
           
           
           
           
           
           
          Send a message
           
           
           stage('Docker Publish to Registry') {
           steps {
           echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
           script {
           def passwordMask = [
           $class: 'MaskPasswordsBuildWrapper',
           varPasswordPairs: [[
           password: secrets.dtrToken
           ]]
           ]
           wrap(passwordMask) {
           sh """
           docker login --username ${secrets.dtrUsername} --password \"${secrets.dtrToken}\" ${dockerRegistry}
           statusCode=\$(curl -X POST -u ${secrets.dtrUsername}:${secrets.dtrToken} -H "Content-Type: application/json" -d '${JsonOutput.toJson(createRepoRequest)}' -o -I -L -s -w "%\{http_code}" ${createRepoApi})
           if [ "\$statusCode" = '201' ]
           then
           echo 'Created docker repository with appropriate permissions.'
           else
           echo 'Create docker repository manually since auto create was not successful.'
           fi
           """
           dockerImage.push();
           }
           }
           }
           }
            Above is the stage I am trying to execute in my jenkins file.
            its only printing below line and stopped in console output.
            echo "Publishing to Docker: ${dockerRegistry}/${dockerImageRepo}:${dockerImageTag}"
            
            And its not printing  sh """docker login --username
            anything from this line 
            
            

            
            
            
            
            
            
            
            
           Send a message
            
            

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            adilm Adil
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: