【问题标题】:How to start build Travis CI project with HTTP API request如何使用 HTTP API 请求开始构建 Travis CI 项目
【发布时间】:2017-05-03 12:03:43
【问题描述】:

我在 GitHub 上上传了一个非常 simple Maven Project 用 Ja​​va 编写的,包括 .yml 文件以集成 Travis CI。 该项目可通过 travis-ci 平台上的相应按钮“重新启动构建”手动构建,但我想使用 API 请求开始构建,如此链接中所述: https://developer.travis-ci.com/resource/build#Build.

我正在使用 RestClient Firefox 插件,但这些命令不起作用。

【问题讨论】:

    标签: java travis-ci rest-client


    【解决方案1】:

    不管你使用的是什么 http 客户端。 您可以访问 travis v3 API。

    来自 Travis API v3 文档[link]的请求示例

    body='{
       "request": {
       "branch":"master"
    }}'
    
    curl -s -X POST \
       -H "Content-Type: application/json" \
       -H "Accept: application/json" \
       -H "Travis-API-Version: 3" \
       -H "Authorization: token xxxxxx" \
       -d "$body" \
    https://api.travis-ci.org/repo/...
    

    【讨论】:

      猜你喜欢
      • 2021-07-15
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-16
      • 1970-01-01
      • 2020-09-04
      相关资源
      最近更新 更多