在我的工作场所,我们使用每月发布的分支,该分支在多个开发人员之间共享。
Gradle版本为2.14.1
我们使用Jenkins手动触发代码的构建和发布(任务)(有效运行-gradle clean compileJava版本)
整个过程大约需要30-40分钟,基本上是编译,生成工件,运行Junit测试并将工件上传到Artifactory。
最终涉及标记和推送版本号的步骤:preTagCommit,它尝试更新gradle.properties并将其版本号提高并进行提交和推送。
此时,如果在过去30-40分钟内分支上没有任何提交(自从手动触发了构建以来,发布就可以成功进行。)>
整个过程之间甚至只有一次提交,但由于错误而失败:任务':preTagCommit'的执行失败。
* error: failed to push some refs to 'xxx.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') hint: before pushing again. *
我尝试了几次黑客攻击,并搜索了文档,但尚未找到合适的解决方案。
这是我的发布步骤的样子:
*** release { project.setProperty("gradle.release.useAutomaticVersion", "true"); newVersionCommitMessage = "Re-snapshoted project to version " preTagCommitMessage = "Preparing version for release " tagCommitMessage = "Tagging Release " tagPrefix = "calypso" requireBranch = "" // Sometimes the plugin trips over its own feet with modifying the gradle.properties // then complaining it has changed. failOnCommitNeeded = false pushToCurrentBranch = true } ***
抱歉,如果以前曾问过这个问题,我发现的所有解决方案都是通用的git方法,而不是使用git的Gradle-Release-Plugin的人。
任何回复将不胜感激。
[在我的工作场所,我们使用每月发布的分支,该分支在多个开发人员之间共享。 Gradle版本为2.14.1我们使用Jenkins(即...
我相信插件的GitHub page中提到了您要查找的标志: