队友一大早提交了代码,然后jekins自动部署就执行失败了。
一脸懵逼的看了下控制台日志:FATAL:Couldnotcheckout5790df9981485c35ae29d54d168de06c49961a7fhudson.plugins.git.GitException:CommandD:\app\Git\Git\bin\git.execheckout-f5790df9981485c35ae29d54d168de06c49961a7freturnedstatuscode1:stdout:stderr:error:unabletocreatefilea.java:FilenametoolongHEADisnowat5790df99Mergebranch'dev'intotestatorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2681)atorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:86)atorg.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2999)Caused:hudson.plugins.git.GitException:Couldnotcheckout5790df9981485c35ae29d54d168de06c49961a7fatorg.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:3023)athudson.plugins.git.GitSCM.checkout(GitSCM.java:1352)athudson.scm.SCM.checkout(SCM.java:505)athudson.model.AbstractProject.checkout(AbstractProject.java:1213)athudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)atjenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)athudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)athudson.model.Run.execute(Run.java:1888)athudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)athudson.model.ResourceController.execute(ResourceController.java:99)athudson.model.Executor.run(Executor.java:431)SSH:Currentbuildresultis[FAILURE],notgoingtorun.Finished:FAILURE关键信息其实就一行:出于隐私,文件名我已经改成a了,原文件名还是挺长的。
那么怎么解决呢?总不能让人家改源码的文件名吧其实很简单,就是一个git的配置而已gitconfig--globalcore.longpathstrue但是这个全局的配置要怎么加呢?这个才是关键的地方。
本质就是在拉代码之前,执行的一个环境参数的命令解决步骤如下:安装插件jekins插件EnvironmentInjector2.选择要执行的item,增加环境变量3.配置变量设置脚本4.保存,重新执行部署脚本,运行成功
版权所有。? Since 2023 .红宝石软件网游戏园 All rights reserved.