5

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.

mosaad
  • 2,276
  • 5
  • 27
  • 49

1 Answers1

6

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 ;
pepoluan
  • 6,132
  • 4
  • 46
  • 76
running.t
  • 5,329
  • 3
  • 32
  • 50