简体   繁体   中英

trigger travis CI build only with specific commit message

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.

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, eg

 script: if [[ $TRAVIS_COMMIT_MESSAGE == *"trigger build"* ]]; then mvn install ; fi ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM