Uploaded image for project: 'Jenkins Website'
  1. Jenkins Website
  2. WEBSITE-455

Could we make the '// Script //' tag/section of the 'pipeline' Asciidoc macro on jenkins.io optional?

    XMLWordPrintable

    Details

    • Type: Task
    • Status: To Do (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I've noticed that jenkins.io builds fail on PRs when the following Asciidoc syntax is encountered:

      [pipeline]
      ----
      // Declarative //
      pipeline {
          // Some valid Pipeline syntax.
      }
      ----
      

      To work around this issue, some contributors (including me now) have been doing the following (i.e. adding '// Script //' tags at the end of the Pipeline to prevent these Jenkins builds from failing):

      [pipeline]
      ----
      // Declarative //
      pipeline {
          // Some valid Pipeline syntax.
      }
      // Script //
      ----
      

      It would be great if this [pipeline] Asciidoc macro could support specifying only the '// Declarative //' tag (or '// Script //' tag for that matter) without the need to specify both '// Declarative //' and '// Script //' tags to prevent build failures.

      Reasons:

      1. Since CloudBees/Jenkins community are moving to declarative Pipelines (over scripted), in many cases, we're going to want to indicate only declarative Pipeline syntax blocks.
      2. While one might argue about the need to use the [pipeline] Asciidoc macro when the textual context refers to declarative Pipeline, it still looks useful having the text "Jenkinsfile (Declarative Pipeline)" above Pipeline code blocks (when you don't want to include any scripted Pipeline syntax) - particularly on pages that indicate both declarative and scripted Pipeline syntax elsewhere.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ggaskell Giles Gaskell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: