Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis conditional on branch after_success

Tags:

travis-ci

In my travis script I have the following:

after_success:
- ember build --environment=production
- ember build --environment=staging --output-path=dist-staging

After both of these build, I conditionally deploy to S3 the one that is appropriate, based on the current git branch.

It works, but it would save time if I only built the one I actually need. What is the easiest way to build based on the branch?

like image 360
Eric Wilson Avatar asked Jan 04 '16 12:01

Eric Wilson


People also ask

Which of the following file is used to configure the Travis CI?

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.

Which of the following type of commands are supported by Travis CLI?

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] .


1 Answers

use the test command as used here.

after_success:
  - test $TRAVIS_BRANCH = "master" &&
    ember build

All travis env variables are available here.

like image 190
Louay Alakkad Avatar answered Oct 25 '22 19:10

Louay Alakkad