【问题标题】:How make travis-ci execute for some branch?如何让 travis-ci 为某个分支执行?
【发布时间】:2019-03-13 22:25:30
【问题描述】:

我的 repo 中有几个分支,我在分支 A 中有 .travis.yml 文件(master 分支没有此文件)。但是 travis-CI 并没有开始构建分支 A。我需要做什么才能为这个分支运行 travis?当我从其他分支向master 创建拉取请求时,travis 开始构建。

附:我关闭/打开Build only if .travis.yml is present,但没有帮助。我也看不到Branches 选项卡中的任何分支。我加了

branches:
  only:
    -A
    -master

.travis.yml,但它也没有帮助。

【问题讨论】:

    标签: github travis-ci


    【解决方案1】:

    您可以尝试检查它是否适用于白名单。
    见“Specify branches to build

    您可以将要构建的分支列入白名单或黑名单:

    # blacklist
    branches:
      except:
        - legacy
        - experimental
    
    # whitelist
    branches:
      only:
        - master
        - stable
    

    尝试将 A 放入 travis.yml 的白名单语法中,看看是否被选中。

    【讨论】:

      【解决方案2】:

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

       branches:
        only:
          - A
          - master
      

      【讨论】:

        【解决方案3】:

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

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

        你可以从here得到这个

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-05-24
          • 1970-01-01
          • 2015-11-14
          • 2020-02-06
          • 2015-10-26
          • 1970-01-01
          相关资源
          最近更新 更多