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.
Trigger Travis CI builds using the API V3 by sending a POST request to /repo/{slug|id}/requests : Get an API token from your Travis CI settings page. You'll need the token to authenticate most of these API requests.
There are three types of commands: Non-API Commands, General API Commands and Repository Commands. All commands take the form of travis COMMAND [ARGUMENTS] [OPTIONS] .
Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.
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 ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With