dwjbosman
dwjbosman

Reputation: 966

How to take a specific action only when manually triggering a build using Travis

I have a Travis project which runs specific tests based on the changes in a Git commit. This ensures that unrelated parts of the project are not retested. This keeps the testing time short.

Now and then I want to run all tests. It would be nice if this could be done by manually clicking the rebuild button in the Travis dashboard.

Is there a way that I can detect during building/testing if the build trigger originated from Git or the UI dashboard (manual build trigger)?

Upvotes: 1

Views: 182

Answers (1)

StephenG
StephenG

Reputation: 2881

You can try using TRAVIS_EVENT_TYPE. For triggered, it's probably going to be api.

See https://docs.travis-ci.com/user/environment-variables/#default-environment-variables

Upvotes: 1

Related Questions