Add GitLFS pull after checkout behaviour to SeedJob GroovyScript Template (#483)

Add GitLFS pull after checkout behaviour to support also repositories which are relying on Git LFS

Close #482
This commit is contained in:
Cosnita Radu Viorel 2021-07-29 12:44:51 +03:00 committed by GitHub
parent 9d5c525ace
commit 935b60b6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -80,6 +80,7 @@ import hudson.plugins.git.BranchSpec;
import hudson.plugins.git.GitSCM; import hudson.plugins.git.GitSCM;
import hudson.plugins.git.SubmoduleConfig; import hudson.plugins.git.SubmoduleConfig;
import hudson.plugins.git.extensions.impl.CloneOption; import hudson.plugins.git.extensions.impl.CloneOption;
import hudson.plugins.git.extensions.impl.GitLFSPull;
import javaposse.jobdsl.plugin.ExecuteDslScripts; import javaposse.jobdsl.plugin.ExecuteDslScripts;
import javaposse.jobdsl.plugin.LookupStrategy; import javaposse.jobdsl.plugin.LookupStrategy;
import javaposse.jobdsl.plugin.RemovedJobAction; import javaposse.jobdsl.plugin.RemovedJobAction;
@ -93,7 +94,10 @@ def jobDslSeedName = "{{ .ID }}-{{ .SeedJobSuffix }}";
def jobRef = jenkins.getItem(jobDslSeedName) def jobRef = jenkins.getItem(jobDslSeedName)
def repoList = GitSCM.createRepoList("{{ .RepositoryURL }}", "{{ .CredentialID }}") def repoList = GitSCM.createRepoList("{{ .RepositoryURL }}", "{{ .CredentialID }}")
def gitExtensions = [new CloneOption(true, true, ";", 10)] def gitExtensions = [
new CloneOption(true, true, ";", 10),
new GitLFSPull()
]
def scm = new GitSCM( def scm = new GitSCM(
repoList, repoList,
newArrayList(new BranchSpec("{{ .RepositoryBranch }}")), newArrayList(new BranchSpec("{{ .RepositoryBranch }}")),