trigger travis CI build only with specific commit message

≯℡__Kan透↙ 提交于 2019-12-21 13:52:42

问题


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.


回答1:


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.

What you could use instead is adding [ci-skip] or [skip-ci] in commit messages to force build skipping.

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 ;


来源:https://stackoverflow.com/questions/44894016/trigger-travis-ci-build-only-with-specific-commit-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!