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

Pipeline script generator generates invalid syntax

XMLWordPrintable

    • 45.v783928138223

      My Jenkins pipeline contains the following

      properties([
          customizeBuildNow([
              alternateBuildButton: 'Build (check DRY_RUN option)', alternateBuildNow: '', alternateBuildWithParams: '']),
      
          parameters([
              booleanParam(name: 'DRY_RUN', defaultValue: false, description: '''\Report what would be run, but do not actually run it'''),
      (etc)
      

      The syntax follows what the Jenkin's pipeline Snippet Generator gives.
      However, using that gives the following error:
      WARNING: Unknown parameter(s) found for class type 'org.jenkinsci.plugins.customizebuildnow.BuildNowTextProperty': alternateBuildButton,alternateBuildNow,alternateBuildWithParams

      Similarly, if I use the Declarative Directive Generator, it tells me to use this

      options {
        customizeBuildNow([alternateBuildButton: 'Build button extra text', alternateBuildNow: '', alternateBuildWithParams: ''])
      }
      

      But that gives the error

      WorkflowScript: 144: Invalid parameter "alternateBuildButton", did you mean "labels"? @ line 144, column 28.
                 customizeBuildNow([alternateBuildButton: 'Build (check DRY_RUN option)', alternateBuildNow: '', alternateBuildWithParams: ''])
      

      I tried a few variants, but could not get it work.

            mawinter69 Markus Winter
            mwebber Matthew Webber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: