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

shared library closure config block not allowed inside declarative pipeline, considered as scripting

XMLWordPrintable

      So for example this piece of library code https://github.com/fabric8io/fabric8-pipeline-library/blob/master/vars/gitTag.groovy

      the closure block's config is considered script, which makes me sad :|
      especially when I want this degree of configuration.

      https://github.com/casz/fabric8-pipeline-library/blob/a89d25a48c894143fc5b180292de1d262564328e/vars/gitTag.groovy

      Error message

      Expected a step @ line 35, column 13.
                     releaseVersion = "${VERSION}"
      

      see the pipeline below:

        pipeline {
          agent {
            label 'linux'
          }
          environment {
            VERSION = "0.2.${BUILD_NUMBER}"
          }
          stages {
            stage('Build Release') {
              when { branch 'master' }
              steps {
                sh "build release"
                gitTag {
                  releaseVersion = "${VERSION}"
                }
              }
            }
          }
        }
      

            abayer Andrew Bayer
            casz Joseph Petersen (old)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: