feat(scm): add git extension for lfs-pull
Add a missing extension to git scm which enables the option to do "Git LFS pull after checkout" Add lfs-pull fixtures Change-Id: Ie8b98877f3f282ac0b32dbeb089e6d0d9ccc25c8
This commit is contained in:
parent
4393f8ba1a
commit
c1d8a41666
@ -456,6 +456,8 @@ def bitbucket_scm(xml_parent, data):
|
|||||||
build changeset (default false)
|
build changeset (default false)
|
||||||
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
||||||
(default true)
|
(default true)
|
||||||
|
* **lfs-pull** (`bool`) - Call git lfs pull after checkout
|
||||||
|
(default false)
|
||||||
|
|
||||||
|
|
||||||
Minimal Example:
|
Minimal Example:
|
||||||
@ -645,6 +647,7 @@ def bitbucket_scm(xml_parent, data):
|
|||||||
# - prune
|
# - prune
|
||||||
# - wipe-workspace
|
# - wipe-workspace
|
||||||
# - use-author
|
# - use-author
|
||||||
|
# - lfs-pull
|
||||||
git_extensions(traits, data)
|
git_extensions(traits, data)
|
||||||
|
|
||||||
|
|
||||||
@ -826,6 +829,8 @@ def git_scm(xml_parent, data):
|
|||||||
build changeset (default false)
|
build changeset (default false)
|
||||||
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
||||||
(default true)
|
(default true)
|
||||||
|
* **lfs-pull** (`bool`) - Call git lfs pull after checkout
|
||||||
|
(default false)
|
||||||
|
|
||||||
Minimal Example:
|
Minimal Example:
|
||||||
|
|
||||||
@ -885,6 +890,7 @@ def git_scm(xml_parent, data):
|
|||||||
# - prune
|
# - prune
|
||||||
# - wipe-workspace
|
# - wipe-workspace
|
||||||
# - use-author
|
# - use-author
|
||||||
|
# - lfs-pull
|
||||||
git_extensions(traits, data)
|
git_extensions(traits, data)
|
||||||
|
|
||||||
|
|
||||||
@ -975,6 +981,8 @@ def github_scm(xml_parent, data):
|
|||||||
build changeset (default false)
|
build changeset (default false)
|
||||||
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
||||||
(default true)
|
(default true)
|
||||||
|
* **lfs-pull** (`bool`) - Call git lfs pull after checkout
|
||||||
|
(default false)
|
||||||
|
|
||||||
Minimal Example:
|
Minimal Example:
|
||||||
|
|
||||||
@ -1111,6 +1119,7 @@ def github_scm(xml_parent, data):
|
|||||||
# - prune
|
# - prune
|
||||||
# - wipe-workspace
|
# - wipe-workspace
|
||||||
# - use-author
|
# - use-author
|
||||||
|
# - lfs-pull
|
||||||
git_extensions(traits, data)
|
git_extensions(traits, data)
|
||||||
|
|
||||||
if data.get("refspecs"):
|
if data.get("refspecs"):
|
||||||
|
@ -327,6 +327,8 @@ def git(registry, xml_parent, data):
|
|||||||
build changeset (default false)
|
build changeset (default false)
|
||||||
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
* **wipe-workspace** (`bool`) - Wipe out workspace before build
|
||||||
(default true)
|
(default true)
|
||||||
|
* **lfs-pull** (`bool`) - Call git lfs pull after checkout
|
||||||
|
(default false)
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@ -733,6 +735,16 @@ def git_extensions(xml_parent, data):
|
|||||||
else:
|
else:
|
||||||
ext = XML.SubElement(xml_parent, ext_name)
|
ext = XML.SubElement(xml_parent, ext_name)
|
||||||
|
|
||||||
|
lfs_pull = str(data.get("lfs-pull", False)).lower()
|
||||||
|
if lfs_pull == "true":
|
||||||
|
ext_name = impl_prefix + "GitLFSPull"
|
||||||
|
if trait:
|
||||||
|
trait_name = "GitLFSPullTrait"
|
||||||
|
tr = XML.SubElement(xml_parent, trait_prefix + trait_name)
|
||||||
|
XML.SubElement(tr, "extension", {"class": ext_name})
|
||||||
|
else:
|
||||||
|
XML.SubElement(xml_parent, ext_name)
|
||||||
|
|
||||||
|
|
||||||
def cvs(registry, xml_parent, data):
|
def cvs(registry, xml_parent, data):
|
||||||
"""yaml: cvs
|
"""yaml: cvs
|
||||||
|
@ -121,7 +121,8 @@
|
|||||||
"clean": true,
|
"clean": true,
|
||||||
"browser": "gitweb",
|
"browser": "gitweb",
|
||||||
"browser-url": "http://review.openstack.org/gitweb?p={project_pattern}.git",
|
"browser-url": "http://review.openstack.org/gitweb?p={project_pattern}.git",
|
||||||
"choosing-strategy": "gerrit"
|
"choosing-strategy": "gerrit",
|
||||||
|
"lfs-pull": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
||||||
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
||||||
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
||||||
|
<hudson.plugins.git.extensions.impl.GitLFSPull/>
|
||||||
</extensions>
|
</extensions>
|
||||||
<browser class="hudson.plugins.git.browser.GitWeb">
|
<browser class="hudson.plugins.git.browser.GitWeb">
|
||||||
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
||||||
|
@ -156,6 +156,9 @@
|
|||||||
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
||||||
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
|
<jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
|
<extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/>
|
||||||
|
</jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
</traits>
|
</traits>
|
||||||
</source>
|
</source>
|
||||||
<strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
<strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
||||||
|
@ -100,3 +100,4 @@ scm:
|
|||||||
skip-notifications: true
|
skip-notifications: true
|
||||||
use-author: true
|
use-author: true
|
||||||
wipe-workspace: true
|
wipe-workspace: true
|
||||||
|
lfs-pull: true
|
||||||
|
@ -114,6 +114,9 @@
|
|||||||
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
||||||
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
|
<jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
|
<extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/>
|
||||||
|
</jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
</traits>
|
</traits>
|
||||||
</source>
|
</source>
|
||||||
<strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
<strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
||||||
|
@ -88,3 +88,4 @@ scm:
|
|||||||
timeout: "100"
|
timeout: "100"
|
||||||
use-author: true
|
use-author: true
|
||||||
wipe-workspace: true
|
wipe-workspace: true
|
||||||
|
lfs-pull: true
|
||||||
|
@ -138,6 +138,9 @@
|
|||||||
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
<jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
<extension class="hudson.plugins.git.extensions.impl.AuthorInChangelog"/>
|
||||||
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
</jenkins.plugins.git.traits.AuthorInChangelogTrait>
|
||||||
|
<jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
|
<extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/>
|
||||||
|
</jenkins.plugins.git.traits.GitLFSPullTrait>
|
||||||
<jenkins.plugins.git.traits.RefSpecsSCMSourceTrait plugin="git">
|
<jenkins.plugins.git.traits.RefSpecsSCMSourceTrait plugin="git">
|
||||||
<templates>
|
<templates>
|
||||||
<jenkins.plugins.git.traits.RefSpecsSCMSourceTrait_-RefSpecTemplate>
|
<jenkins.plugins.git.traits.RefSpecsSCMSourceTrait_-RefSpecTemplate>
|
||||||
|
@ -100,3 +100,4 @@ scm:
|
|||||||
skip-notifications: true
|
skip-notifications: true
|
||||||
use-author: true
|
use-author: true
|
||||||
wipe-workspace: true
|
wipe-workspace: true
|
||||||
|
lfs-pull: true
|
||||||
|
@ -37,6 +37,7 @@ bob@example.com</excludedUsers>
|
|||||||
<hudson.plugins.git.extensions.impl.PerBuildTag/>
|
<hudson.plugins.git.extensions.impl.PerBuildTag/>
|
||||||
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
||||||
<hudson.plugins.git.extensions.impl.AuthorInChangelog/>
|
<hudson.plugins.git.extensions.impl.AuthorInChangelog/>
|
||||||
|
<hudson.plugins.git.extensions.impl.GitLFSPull/>
|
||||||
</extensions>
|
</extensions>
|
||||||
<browser class="hudson.plugins.git.browser.GithubWeb">
|
<browser class="hudson.plugins.git.browser.GithubWeb">
|
||||||
<url>http://github.com/foo/example.git</url>
|
<url>http://github.com/foo/example.git</url>
|
||||||
|
@ -14,3 +14,4 @@ scm:
|
|||||||
scm-name: something_special
|
scm-name: something_special
|
||||||
use-author: true
|
use-author: true
|
||||||
wipe-workspace: false
|
wipe-workspace: false
|
||||||
|
lfs-pull: true
|
||||||
|
@ -37,6 +37,7 @@ bob@example.com</excludedUsers>
|
|||||||
<hudson.plugins.git.extensions.impl.PerBuildTag/>
|
<hudson.plugins.git.extensions.impl.PerBuildTag/>
|
||||||
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
||||||
<hudson.plugins.git.extensions.impl.AuthorInChangelog/>
|
<hudson.plugins.git.extensions.impl.AuthorInChangelog/>
|
||||||
|
<hudson.plugins.git.extensions.impl.GitLFSPull/>
|
||||||
</extensions>
|
</extensions>
|
||||||
<browser class="hudson.plugins.git.browser.GithubWeb">
|
<browser class="hudson.plugins.git.browser.GithubWeb">
|
||||||
<url>http://github.com/foo/example.git</url>
|
<url>http://github.com/foo/example.git</url>
|
||||||
|
@ -14,3 +14,4 @@ scm:
|
|||||||
scm-name: something_special
|
scm-name: something_special
|
||||||
use-author: true
|
use-author: true
|
||||||
wipe-workspace: false
|
wipe-workspace: false
|
||||||
|
lfs-pull: true
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
||||||
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
<hudson.plugins.git.extensions.impl.PruneStaleBranch/>
|
||||||
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
||||||
|
<hudson.plugins.git.extensions.impl.GitLFSPull/>
|
||||||
</extensions>
|
</extensions>
|
||||||
<browser class="hudson.plugins.git.browser.GitWeb">
|
<browser class="hudson.plugins.git.browser.GitWeb">
|
||||||
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
browser: gitweb
|
browser: gitweb
|
||||||
browser-url: http://review.openstack.org/gitweb?p={project_pattern}.git
|
browser-url: http://review.openstack.org/gitweb?p={project_pattern}.git
|
||||||
choosing-strategy: gerrit
|
choosing-strategy: gerrit
|
||||||
|
lfs-pull: true
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
name: complete001
|
name: complete001
|
||||||
|
Loading…
Reference in New Issue
Block a user