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

Pipeline editor not working if Script Path is set

    Details

    • Similar Issues:

      Description

      I have created a pipeline from a GitHub repository. Inside this repository, there is a subfolder called jenkins with a Jenkinsfile inside, just like in the example app: https://github.com/jenkins-docs/creating-a-pipeline-in-blue-ocean. Blue Ocean prompted me to design a new pipeline. Instead, I went to the settings and set the Script Path manually to 'jenkins/Jenkinsfile':

      It does work as intended. The hooks are activated and the pipeline is run properly, but if I try to edit the pipeline using pipeline editor, it shows an empty pipeline. If I do implement a pipeline in the editor and save it, a Jenkinsfile is created in the root of my repository.

      It seems the pipeline editor is not getting the Jenkinsfile path from 'Script Path' setting

        Attachments

          Issue Links

            Activity

            Hide
            andrejesus André Jesus added a comment -

            Hi!

            Have the same issue, not on a different path, but just with a different name.

            Can't find a solution for this.

            Show
            andrejesus André Jesus added a comment - Hi! Have the same issue, not on a different path, but just with a different name. Can't find a solution for this.
            Hide
            ms3cat Sam Zhao added a comment -

            Have the same problem. Only can build with a different Jankinsfile name. Can't modify pipeline by pipeline-editor.

            Show
            ms3cat Sam Zhao added a comment - Have the same problem. Only can build with a different Jankinsfile name. Can't modify pipeline by pipeline-editor.
            Hide
            antticgi Antti Turpeinen added a comment -

            I also have the same problem. We have multiple projects inside one git repository and we would like to use multiple Jenkinsfile. It would be great if we could use git sparse checkout and set Jenkinsfile inside those "sparsed" folders. At least the editor should be able to use the correct Jenkinsfile. 

            Show
            antticgi Antti Turpeinen added a comment - I also have the same problem. We have multiple projects inside one git repository and we would like to use multiple Jenkinsfile. It would be great if we could use git sparse checkout and set Jenkinsfile inside those "sparsed" folders. At least the editor should be able to use the correct Jenkinsfile. 
            Hide
            stelminator Christopher Stelma added a comment -

            I couldn't find any reference to the path in the /blue/rest/ api responses, which makes some sense because the objects on that API all seem to be from the perspective of the pipeline, not from the job that defines the pipeline.  i.e. I'm not sure where the path would go, maybe on the pipeline object, maybe on the scm object below that, but neither feels quite right.  However, since this is the api used to fill the editor, it really should go somewhere.

            Show
            stelminator Christopher Stelma added a comment - I couldn't find any reference to the path in the /blue/rest/ api responses, which makes some sense because the objects on that API all seem to be from the perspective of the pipeline, not from the job that defines the pipeline.  i.e. I'm not sure where the path would go, maybe on the pipeline object, maybe on the scm object below that, but neither feels quite right.  However, since this is the api used to fill the editor, it really should go somewhere.
            Hide
            jyanko Jim Yanko added a comment -

            Just discovered this problem today while working on team adoption of Jenkins / BlueOcean.

            In our case, dev started out with placing the Jenkinsfile at the repo path /build/Jenkinsfile rather than at /Jenkinsfile and defining the path to the jenkinsfile in the job here http://<hostname>/jenkins/job/<jobname>/configure

            As others have mentioned, builds do run, but the BlueOcean editor does not show any stages or steps when a user looks there.  This in turn creates confusion since they see the steps in the build results screen, but not in the editor screen where they expect to see them.

            At this point, I'm concerned of the psychology at play when working with teams to get started using this.  One of the selling points on BlueOcean to management is that it makes it easy to use and build the job steps, and the code gets commited to your repo easily.   So changes can be made in a UI or by hand.

            In practice, when one project keeps the Jenkinsfile at root and another stores it elsewhere, this confuses the newer user who may be looking at a job configured by someone else for inspiration on how to add steps to a project/pipeline they are working on themselves when they see stages and steps in one project that but another appears to have no steps when they look at it in the UI.

             

             

             

             

             

            Show
            jyanko Jim Yanko added a comment - Just discovered this problem today while working on team adoption of Jenkins / BlueOcean. In our case, dev started out with placing the Jenkinsfile at the repo path /build/Jenkinsfile rather than at /Jenkinsfile and defining the path to the jenkinsfile in the job here http://<hostname>/jenkins/job/<jobname>/configure As others have mentioned, builds do run, but the BlueOcean editor does not show any stages or steps when a user looks there.  This in turn creates confusion since they see the steps in the build results screen, but not in the editor screen where they expect to see them. At this point, I'm concerned of the psychology at play when working with teams to get started using this.  One of the selling points on BlueOcean to management is that it makes it easy to use and build the job steps, and the code gets commited to your repo easily.   So changes can be made in a UI or by hand. In practice, when one project keeps the Jenkinsfile at root and another stores it elsewhere, this confuses the newer user who may be looking at a job configured by someone else for inspiration on how to add steps to a project/pipeline they are working on themselves when they see stages and steps in one project that but another appears to have no steps when they look at it in the UI.          
            Hide
            rbaron Raphael Baron added a comment -

            I'm experiencing the same issue. My use case is: I have a monorepo with independent pipelines (different Jenkinsfiles) on two subdirectories. Both pipelines run fine and show the correct step in blue ocean. Only the editor doesn't seem to recognize the Jenkinsfiles - it shows an empty view when you try to edit any of them.

            Show
            rbaron Raphael Baron added a comment - I'm experiencing the same issue. My use case is: I have a monorepo with independent pipelines (different Jenkinsfiles) on two subdirectories. Both pipelines run fine and show the correct step in blue ocean. Only the editor doesn't seem to recognize the Jenkinsfiles - it shows an empty view when you try to edit any of them.

              People

              • Assignee:
                lanwen Kirill Merkushev
                Reporter:
                vitor Vitor Durante
              • Votes:
                5 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated: