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

Add explicit support for git lfs

    XMLWordPrintable

Details

    Description

      I would like to use git lfs and I would like to jenkins, and I would like for jenkins to use its same credentials already configured for git to fetch the git lfs resources. Rather than trying to change the init+fetch pattern, I would like to add a custom behavior to the git plugin that will execute `git lfs pull` after checkout using the same credentials as the fetch command.

      It seems that git lfs is the way forward for git repos with large files and I don't see a workaround right now for using git lfs with jenkins, short of sprinkling credentials everywhere so that `git lfs` can be run from the build context which doesn't seem like a good idea.

      I am looking into what it would take to add this. Would the maintainers be interested in taking in such a feature?

      Attachments

        Issue Links

          Activity

            markewaite Mark Waite added a comment -

            Not yet. I still need to release the git-plugin that includes the fix. I hope to do that within the next 24 hours.

            markewaite Mark Waite added a comment - Not yet. I still need to release the git-plugin that includes the fix. I hope to do that within the next 24 hours.
            matthauck Matt Hauck added a comment -

            Ah, roger. Just upgraded and realized it wasn't there yet, haha.

            matthauck Matt Hauck added a comment - Ah, roger. Just upgraded and realized it wasn't there yet, haha.
            markewaite Mark Waite added a comment -

            Git plugin 3.1.0 released on 4 Mar 2017 now includes support for command line git large file support.

            markewaite Mark Waite added a comment - Git plugin 3.1.0 released on 4 Mar 2017 now includes support for command line git large file support.

            markewaite that's a wonderful job for supporting git LFS, thanks a lot!

            Is there a way I can use it with pipelines? I've been trying to find examples and/or documentation with no luck. 

            lantero Carlos Ruiz Lantero added a comment - markewaite that's a wonderful job for supporting git LFS, thanks a lot! Is there a way I can use it with pipelines? I've been trying to find examples and/or documentation with no luck. 
            markewaite Mark Waite added a comment - - edited

            The "pipeline syntax" link on most pipeline job pages will present a dropdown of pipeline steps.  One of those is "checkout".  Inside that "checkout" step, you can select git as the source control system, then add the "Additional Behaviour" for Git LFS pull.

            If you prefer to read a script example, refer to the Jenkinsfile in my jenkins-bugs repo. That shows an example using GitLFSPull in a pipeline definition.

            markewaite Mark Waite added a comment - - edited The "pipeline syntax" link on most pipeline job pages will present a dropdown of pipeline steps.  One of those is "checkout".  Inside that "checkout" step, you can select git as the source control system, then add the "Additional Behaviour" for Git LFS pull. If you prefer to read a script example, refer to the Jenkinsfile in my jenkins-bugs repo. That shows an example using GitLFSPull in a pipeline definition.

            People

              markewaite Mark Waite
              matthauck Matt Hauck
              Votes:
              14 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: