如何让travis-ci为某个分支执行?

时间:2015-04-07 23:57:12

标签: github travis-ci

我的仓库中有一些分支,我在分支.travis.yml中有A文件(master分支没有此文件)。但是travis-CI没有开始分支A的构建。如何为此分支运行travis需要做什么?当我从其他分支创建一个Pull Request到master时,travis就会启动构建。

P.S。我关掉了Build only if .travis.yml is present,但没有用。此外,我在Branches标签中看不到任何分支。我添加了

branches:
  only:
    -A
    -master
<{1>}中的

,但它也无济于事。

3 个答案:

答案 0 :(得分:24)

您可以尝试检查它是否适用于白名单 请参阅&#34; Specify branches to build&#34;

您可以建立您想要构建的白色或黑名单分支:

# blacklist
branches:
  except:
    - legacy
    - experimental

# whitelist
branches:
  only:
    - master
    - stable

尝试在travis.yml中将A添加到白名单语法中,然后查看是否已选中。

答案 1 :(得分:2)

您在.travis.yml中的样本与yml不兼容。您需要在分支名称之前放置一个空格。

 branches:
  only:
    - A
    - master

答案 2 :(得分:1)

除了添加白名单分支外,您还可以向感兴趣的分支添加.travis.yml文件。

Note that for historical reasons .travis.yml needs to be present on
all active branches of your project.

您可以从here

相关问题