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

Build parameters are not passed to declarative pipelines

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We're using List maven artifact version in a parameterized build to pass the application artifact version as a parameter to a declarative pipeline script. Unfortunately this does not work (using ${params.ESB_VERSION} as well as ${env.ESB_VERSION}) and the parameter name is always resolved to 'null'.

      Declarative pipeline script:

       

      pipeline {
          agent {
              label "docker"
          }
      
          stages {
              […]
      
              stage('Build image') {
                  agent {
                      dockerfile {
                          reuseNode true
                          registryUrl "https://registry.comapny.com"
                          registryCredentialsId "dcr-jenkins"
                          additionalBuildArgs "--pull --build-arg ESB_VERSION=${params.ESB_VERSION}"
                          dir "installation/app"
                      }
                  }
      
                  steps {
                      script {
                          docker {
                              app = docker.build "company/app"
                          }
                      }
                  }
              }
      
              […]
      
          }
      }
      
      

      Job execution:

       

       

      [Job_Name] Running shell script
      + docker build -t 0ed28f6bfba3f17d99c8f8689058b9f5c00e8bf3 --pull --build-arg ESB_VERSION=null -f installation/app/Dockerfile installation/app
      

      Note the ESB_VERSION=null string.

       

       

        Attachments

          Issue Links

            Activity

            stephan Stephan Austermühle created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Assignee Gesh Markov [ gesh ] Andrew Bayer [ abayer ]
            jglick Jesse Glick made changes -
            Component/s maven-metadata-plugin [ 17226 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s maven-metadata-plugin [ 17226 ]
            Component/s pipeline-model-definition-plugin [ 21706 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ] Gesh Markov [ gesh ]
            torstenreinhard Torsten Reinhard made changes -
            Link This issue relates to JENKINS-38619 [ JENKINS-38619 ]

              People

              • Assignee:
                gesh Gesh Markov
                Reporter:
                stephan Stephan Austermühle
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: