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

Updated Plugin is creating new directory with random directory name, even while using NullSCM class.

    XMLWordPrintable

Details

    Description

      I want to use Jenkinsfile from local system, and thus I'm using hudson.NullSCM class of workflow-cps plugin. In earlier versions using this class didn't created any new directory. While in the latest version upgrade it is performing checkout and creating a new directory with random directory name, and searching the script in that location. 
      I want a workaround or fix of this issue, as its a blocker in a Jenkins plugin that I'm working on.

      Attachments

        Issue Links

          Activity

            bmaehr Bernhard M added a comment -

            Hint: Temporary workaround I started to use: Manually create in each workspace symbolic links for the files needed during execution in the @script directory pointing to the file in the directory with the random name.

            bmaehr Bernhard M added a comment - Hint: Temporary workaround I started to use: Manually create in each workspace symbolic links for the files needed during execution in the @script directory pointing to the file in the directory with the random name.

            My organization's problem with the random directory name is primarily the length of the name. Our controller cannot do a lightweight checkout of the repo so it creates non lightweight checkout on the controller and then runs the job on a node. But since our controller runs on Windows and the hash directory is 65 chars long we hit the maximum path length in Windows and cannot complete the checkout. (Large repo with several layers of directories.)

            I guess we can do a workaround and skip checking out via Jenkins git and do it by script/build step, but it doesn't really feel right...

            annafreiholtz Anna Freiholtz added a comment - My organization's problem with the random directory name is primarily the length of the name. Our controller cannot do a lightweight checkout of the repo so it creates non lightweight checkout on the controller and then runs the job on a node. But since our controller runs on Windows and the hash directory is 65 chars long we hit the maximum path length in Windows and cannot complete the checkout. (Large repo with several layers of directories.) I guess we can do a workaround and skip checking out via Jenkins git and do it by script/build step, but it doesn't really feel right...
            d4rkf1r3fly Pascal Jacob added a comment -

            My workaround: when using a declarative pipeline instead of a scripted pipeline, Jenkins will also checkout the script repo into your workspace. This way, the auto generated sub dir can be ignored. So you can just import your libs using:

            def myVar = load "./<path_to_script>";

            Instead of:

            def rootDir = pwd();
            def myVar = load "${rootDir}@script/<path_to_script>";
            d4rkf1r3fly Pascal Jacob added a comment - My workaround: when using a declarative pipeline instead of a scripted pipeline, Jenkins will also checkout the script repo into your workspace. This way, the auto generated sub dir can be ignored. So you can just import your libs using: def myVar = load "./<path_to_script>" ; Instead of: def rootDir = pwd(); def myVar = load "${rootDir}@script/<path_to_script>" ;
            jglick Jesse Glick added a comment -

            the length of the name. Our controller cannot do a lightweight checkout of the repo

            Sounds like JENKINS-67836.

            jglick Jesse Glick added a comment - the length of the name. Our controller cannot do a lightweight checkout of the repo Sounds like JENKINS-67836 .
            dnusbaum Devin Nusbaum added a comment - - edited

            See this comment for discussion of some supported alternatives if the related changes break your use case.

            See JENKINS-67836 if the length of the directory names is causing issues for you.

            dnusbaum Devin Nusbaum added a comment - - edited See this comment for discussion of some supported alternatives if the related changes break your use case. See JENKINS-67836 if the length of the directory names is causing issues for you.

            People

              Unassigned Unassigned
              sam_nagarro Samarth Agarwal
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: