仅使用特定提交消息来触发travis CI构建 [英] trigger travis CI build only with specific commit message
问题描述
仅当我有certian提交消息时,我才希望travis开始. 我怎样才能做到这一点.我的travis.yml文件是此处
I want travis to start only if I have a certian commit message. how can i do this. My travis.yml file is here
I know there is an on condition from this question but I dont know where to put it.
推荐答案
The question you mentioned regards deploying travis build. So on:
condition only determines if build is deployed or not. Regardless this setting other build steps are executed on each commit/pull request.
您可以改用的是在提交消息中添加[ci skip]
或[skip ci]
来强制
What you could use instead is adding [ci skip]
or [skip ci]
in commit messages to force build skipping.
您还可以使用TRAVIS_COMMIT_MESSAGE
默认环境变量在您的所有构建步骤中确定是应该执行还是跳过步骤,例如
You can also use TRAVIS_COMMIT_MESSAGE
default env variable in all your build steps to determine if step should be executed or skipped, e.g.
script: if [[ $TRAVIS_COMMIT_MESSAGE == *"trigger build"* ]]; then mvn install ; fi ;
这篇关于仅使用特定提交消息来触发travis CI构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!