使用Maven-release-plugin时管道循环

时间:2018-07-12 14:04:06

标签: git maven-release-plugin bitbucket-pipelines

强文本,我有一个管道设置,可以在提交到特定分支时自动发布。问题是我使用的maven-release-plugin将其更改提交到相同的存储库和分支。这将触发相同的管道并创建循环。

如何排除特定分支的某些提交?

- step:
    name: TEST01 - Automatic build and test
    caches:
      - maven
    script:
      # Here I would like to add a check to stop if some criteria is met like commitmessage==[maven-release-plugin] or something similar
      - mvn release:clean release:prepare --batch-mode -f ggw- core/pom.xml -s ggw-core/external/settings-test01.xml
      - mvn release:perform -f ggw-core/pom.xml -s ggw-core/external/settings-test01.xml -X -e

1 个答案:

答案 0 :(得分:1)

从Atlassian团队那里得到答案,而且要切合实际! :)

只需添加标志-DscmCommentPrefix =“ [skip ci]”,如下所示, maven-release-plugin将忽略其他提交。

- mvn -batch-mode release:prepare -DscmCommentPrefix="[skip ci]" 

要获得更完整的答案,请点击链接。

https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-configure-my-pipeline-to-control-versioning/qaq-p/553721#M91377