post Support for a stage

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      According to Jenkins documentation, post should be usable after all steps or a single step

       

      The post section defines one or more additional steps that are run upon the completion of a Pipeline's or stage's run (depending on the location of the post section within the Pipeline).

       

      From <https://jenkins.io/doc/book/pipeline/syntax/#post>

       

      I am encountering this error

       

      WorkflowScript: 17: Expected a stage @ line 21, column 3.
                         post
           ^

      1 error

       

      for the following:

       

      pipeline
      {
          agent any

          stages
          {
              stage('Some Action')
              {
                 steps
                 {
                   script
                   

      {                println "do something"              }

                 }
              }
              post
              {

                   always

                 

      {                 println "Do some work"             }

              }
         }
      }

       

      I believe this syntax correct. I can find no examples to show otherwise. Hopefully you do not mean stages' run.

       

            Assignee:
            Unassigned
            Reporter:
            Paul Tletski
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: