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

Defining dockerfile agent in shared library broken since 1.2

XMLWordPrintable

      Before declarative pipeline 1.2 the following used to work:

      1. The following function is defined in a shared library

      # vars/support.groovy
      
      def ciDockerfile(projectId, additionalArgs = "") {
        { it ->
          dir "dockerfiles/ci"
          additionalBuildArgs ciDockerFileBuildArgs()
          args "${ciDockerFileRunArgs(projectId)} ${additionalArgs}"
        }
      }

      2. In the Jenkinsfile

      pipeline {
        agent {
          dockerfile support.ciDockerfile(projectId)
        }
      
        ...
      }
      

       

      However since declarative 1.2 the closure seems to be no longer evaluated. The arguments defined in the library are simply ignored.

            abayer Andrew Bayer
            pascalw Pascal Widdershoven
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: