gpt4 book ai didi

macos - Jenkins 多分支管道 : git-lfs command not found on Mac node

转载 作者:行者123 更新时间:2023-12-05 02:10:53 25 4
gpt4 key购买 nike

我有一个 Jenkins 多分支管道,配置为在通过 javaws 配置的 mac 10.14 节点上运行测试和 sonarqube 扫描。在结帐时,它在 scm 结帐期间失败:

[Pipeline] End of Pipeline
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
hudson.plugins.git.GitException: Command "/usr/local/bin/git checkout -f 7dca678ce3a4a8f93fe8ed4bb4920db40c417839" returned status code 128:
stdout:
stderr: git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2172)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1000(CliGitAPIImpl.java:78)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2453)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from platform-e2e-mac.mynetwork.com/10.1.4.49:49175
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:955)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor761.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy102.execute(Unknown Source)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1242)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Caused: hudson.plugins.git.GitException: Could not checkout AUTH-58-pipeline with start point 7dca678ce3a4a8f93fe8ed4bb4920db40c417839
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2493)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:97)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

我试过:

  1. 通过 Homebrew 安装并初始化了 git-lfs。
  2. 删除自制版本并手动安装 git-lfs,但将 git-lfs 二进制文件放入/usr/local/bin 并使用 git lfs install 对其进行初始化。 (包含在我节点的 $PATH 中)
  3. 通过自制软件(而不是苹果开发工具)安装了 git 本身,并在节点的工具配置中将其配置为默认 git 工具(确认已使用)
  4. 在系统和本地级别初始化 git-lfs。

我找了几篇文章,但都没有解决问题。它只是在结账时找不到 git-lfs。

由于 OSX 系统完整性保护,我无法将 git-lfs 移动到 /usr/bin 中,这里是否缺少某个步骤或配置?

如果我可以提供更多详细信息,请告诉我。

最佳答案

在 Jenkins 问题中的另一个线程的帮助下解决了这个问题:https://issues.jenkins-ci.org/browse/JENKINS-52857 (特别是 Jeff Meador 和 Lars Bilke 的评论)

为了解决这个问题,我通过自制软件安装了 git 和 git-lfs。然后我做了一个 git --exec-path 来确定我使用的 git 版本的安装路径,对我来说是 /usr/local/Cellar/git/2.23.0_1/libexec/git-core/git.

我将 git-lfs 二进制文件从它的 Cellar 位置复制到上面提到的 git-core 文件夹中,然后将它链接到这个位置:ln -s/usr/local/Cellar/git/2.23.0_1/libexec/git-core/git-lfs/usr/local/bin/git-lfs。就绪后,我重新运行构建,我不再收到指示未找到 git-lfs 的错误消息。

希望这对某人有帮助。

关于macos - Jenkins 多分支管道 : git-lfs command not found on Mac node,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58052562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com