我尝试使用Artifactory插件尝试Jenkins发布分段功能:
以下是正在发生的事情的摘要。除了最后一项的错误外,一切都是正确的:
gradle.properties
中提交版本更改。将它推送到git服务器。git checkout master
上出错。这个命令在git repo的本地克隆上运行正常。 '主'是此测试项目中正常dev分支的正确名称。我无法想象为什么这不起作用。
仅供参考,这是一个使用我的开发笔记本电脑上运行的临时服务器的测试项目。
这是Jenkins控制台输出:
:my-great-lib:artifactoryPublish
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1-sources.jar
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1.pom
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1.jar
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1-sources.jar
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1-javadoc.jar
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1.pom
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1-javadoc.jar
Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1.jar
Deploying build info to: http://localhost:8081/artifactory/api/build
BUILD SUCCESSFUL
Total time: 6.243 secs
Build step 'Invoke Gradle script' changed build result to SUCCESS
[RELEASE] Committing release version on branch 'REL-BRANCH-1.0.1c'
[RELEASE] Pushing branch 'REL-BRANCH-1.0.1c' to 'ssh://git@localhost:7999/test/atest.git'
Failure in post build SCM action: Failed checkout branch: Command "git checkout master" returned status code 1:
stdout:
stderr: error: pathspec 'master' did not match any file(s) known to git.
ERROR: [RELEASE] Failed on build completion
java.io.IOException: Failed checkout branch: Command "git checkout master" returned status code 1:
stdout:
stderr: error: pathspec 'master' did not match any file(s) known to git.
at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234)
at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60)
at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137)
at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:674)
at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:644)
at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
at hudson.model.Run.execute(Run.java:1726)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Finished: FAILURE
答案 0 :(得分:3)
使用启用详细日志记录 设置ANT_ARGS = -d
然后您应该能够理解它尝试结帐操作的目录。 转到该目录并查看是否在那里克隆了存储库?