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

Pipelines cannot change directory if directory is called stage

XMLWordPrintable

      In the latest version of Jenkins LTS, if you create a pipeline and make Groovy code that changes to a directory called 'stage', "stage", or '''stage''', it will still try and interpret it to a build stage and expect a name argument. If you go dir 'stage' {}, it will complain that you provided a closure to the name argument of a stage command.

      Furthermore (and, I find this even stranger), this Groovy code STILL tries to run stage in the same spot.

      //This occurs with 'stage', "stage", or '''stage'''
      def STG_DIRECTORY = 'stage'
      dir STG_DIRECTORY {
          //Some code
      }
      

            abayer Andrew Bayer
            charlestoller Charles Toller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: