How make travis-ci execute for some branch?

Artur Sh picture Artur Sh · Apr 8, 2015 · Viewed 15.3k times · Source

I have a few branches in my repo and I have the .travis.yml file in a branch A (master branch does not have this file). But travis-CI is not starting the build for branch A. What do I need to do to run travis for this branch? When I create a Pull Request from some other branch to master, then travis starts the build.

P.S. I turned off/on Build only if .travis.yml is present but it did not help. Also I can't see any branches in Branches tab. I added

branches:
  only:
    -A
    -master

in the .travis.yml, but it too did not help.

Answer

VonC picture VonC · Apr 8, 2015

You can try and check if it would work with a whitelist.
See "Specify branches to build"

You can either white- or blacklist branches that you want to be built:

# blacklist
branches:
  except:
    - legacy
    - experimental

# whitelist
branches:
  only:
    - master
    - stable

Try and put A in a whitelist syntax in the travis.yml, and see if that is picked-up.