赞
踩
需求 想要jenkins每次构建项目成功后给Git仓库打一个tag,以便下次构建出现问题可以及时通过tag恢复到上一个版本
在刚开始研究使用Jenkins自动打tag时候一直不成功,查了好久也没找到原因,报如下错误:
using credential 640821c9-e50e-43f3-9747-773408bff018 > git.exe tag -l v1.0.1 # timeout=10 > git.exe tag -a -f -m Jenkins自动化生成Tag v1.0.1 # timeout=10 ERROR: Failed to push tag v1.0.1 to pig hudson.plugins.git.GitException: Could not apply tag v1.0.1 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.tag(CliGitAPIImpl.java:1531) at hudson.plugins.git.GitAPI.tag(GitAPI.java:274) at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:277) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1841) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "git.exe tag -a -f -m Jenkins自动化生成Tag v1.0.1" returned status code 128: stdout: stderr: *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'SYSTEM@*********.(none)') at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2010) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2006) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1638) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1650) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.tag(CliGitAPIImpl.java:1529) ... 11 more Build step 'Git Publisher' marked build as failure Finished: FAILURE
之前遇到过Jenkins执行scp命令报 scp 不是内部或外部命令,也不是可运行的程序,或批处理文件。 的错误,但是打开Dos窗口执行scp命令就可以正常执行,经过一些文章查找,有看到过是账户权限问题,对于上面的错误,我也怀疑是这个问题所致,所以做如下操作:
注:本人Jenkins是放在自己开发机上,是Windows环境
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。