Travis CI build trigger with only specific commit message
I only want travis to run if I have a certian commit message. How can i do this. My travis.yml file is here
I know there is this question condition , but I don't know where to put it.
question you mentioned about deploying the travis build. So the condition on:
only determines whether the assembly is deployed or not. Regardless of this setting, other build steps are performed on each commit / pull request.
Instead, you can add [ci-skip]
or [skip-ci]
in commit messages to force the skip .
You can also use the TRAVIS_COMMIT_MESSAGE
env variable in all your follow steps to determine if a step should be executed or skipped, for example
script: if [[ $TRAVIS_COMMIT_MESSAGE == *"trigger build"* ]]; then mvn install ; fi ;