Gil O.
Gil O.

Reputation: 123

Travis CI kick off build on new tag

I am trying to use travis for continues integration with github. I want to create a custom deploy on new tags. The problem is I can not get travis to kick of the build when I create tag.

I believe an alternative would be to create a release branch...

my travis.yml looks like this

language: node_js
node_js:
   - "0.10"
# whitelist
branches:
  only:
    - master

after_success:
  ./build/update-ghpages.sh

Upvotes: 5

Views: 3011

Answers (2)

Shamm
Shamm

Reputation: 1004

Safelisting also prevents tagged commits from being built. To allow tags trigger the build consider adding tags to the whitelist with regular expressions, for example /^v\d+.\d+(.\d+)?(-\S*)?$/ if you use v1.0 naming pattern For additional information go here

Upvotes: 1

joshua-anderson
joshua-anderson

Reputation: 4466

Here's a few things:

Are you pushing your tags to github with git push --tags? Are you pulling your tags on travis-ci with git fetch --tags?

You branch white list could also prevent tagged builds from running, as they could be blocked for not being master branch.

Are your tags based off branch master? If so then the last comment shouldn't apply, as the tagged commit should still be built from the commit on master and your deployment program will still recognize it is a tag if git fetch --tags is performed.

If none of these suggestions help you I'll be happy to take a look at your setup if you give me a link to your travis-ci build.

Upvotes: 3

Related Questions