Sid*_*ath 5 git bitbucket jenkins git-lfs
我在Jenkins中使用git LFS时遇到了问题.我现在正在做的是
我们在Jenkins中分别使用了git插件和git-client插件,版本分别为3.3.0和2.4.2.
怎么了:
A.war - > a.jar(其原始大小为1234 kb,但它的速度为3 kb(指针文件的大小)
所以我的问题是:
小智 14
这可以使用Jenkins 的常规Git +插件(版本3.1.0以后)完成.
如果您正在使用Jenkins管道(即在您的仓库的根目录中使用Jenkins文件),关键是[$class: 'GitLFSPull']在您的checkout()调用中包含该扩展.这是一个(编辑过的)示例,取自我们的一个回购:
checkout([ $class: 'GitSCM',
branches: [[name: 'refs/heads/'+env.BRANCH_NAME]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'GitLFSPull'],
[$class: 'CheckoutOption', timeout: 20],
[$class: 'CloneOption',
depth: 0,
noTags: false,
reference: '/other/optional/local/reference/clone',
shallow: false,
timeout: 120]
],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'foobar',
url: 'https://github.com/foo/bar.git']
]
])
Run Code Online (Sandbox Code Playgroud)
使用Snippet Generator,可以通过从"Additional Behaviors"菜单中选择"结账后的Git LFS拉取"来生成此代码.在此处查看截图
Pri*_*eja 10
这可以通过“Pre SCM BuildStep”插件来完成。
在 Jenkins 中添加“Pre SCM BuildStep”插件。
在作业配置中
在 Build Environment 部分选择属性Run buildstep before SCM running
单击添加构建步骤
选择执行 Shell或执行 Windows 批处理命令。
在shell中添加以下命令,
git lfs 安装
在 Source Code Management 部分 -> Additional Behaviors -> Add Git LFS pull after checkout。