在不推动提交的情况下触发Travis-CI重建?

本文翻译自:Trigger a Travis-CI rebuild without pushing a commit?

Using Travis-CI, is it possible to trigger a rebuild without pushing a new commit to GitHub? 使用Travis-CI,是否可以在不将新提交提交到GitHub的情况下触发重建?

Use case: A build fails due to an externality. 用例:由于外部性,构建失败。 The source is actually correct. 资料来源实际上是正确的。 It would build OK and pass if simply re-run. 如果只是重新运行,它将建立OK并通过。

For instance, an apt-get fails due to a package server being down, but the server is back up again. 例如, apt-get因软件包服务器关闭而失败,但服务器又重新备份。 However the build status is "stuck" at "failed" until a new commit is pushed. 但是,在推送新提交之前,构建状态为“卡住”为“失败”。

Is there some way to nudge Travis-CI to do another build, other than pushing a "dummy" commit? 除了推动“虚拟”提交以外,是否有某种方法可以使Travis-CI进行其他构建?


#1楼

参考:https://stackoom.com/question/1BsLq/在不推动提交的情况下触发Travis-CI重建


#2楼

  • If you have write access to the repo : On the build's detail screen, there is a button with the tooltip "Restart Build". 如果您对存储库具有写权限,则 :在构建的详细信息屏幕上,有一个 ,其提示为“重新启动构建”。

    Note : Browser extensions like Ghostery may prevent the restart button from being displayed. 注意 :诸如Ghostery之类的浏览器扩展程序可能会阻止重新启动按钮的显示。 Try disabling the extension or white-listing Travis CI. 尝试禁用扩展或将Travis CI列入白名单。

    Note2 : If .travis.yml configuration has changed in the upstream, clicking rebuild button will run travis with old configuration. 注意2 :如果.travis.yml配置在上游已更改,则单击“重建”按钮将使用旧配置运行travis。 To apply upstream changes for travis configuration one has to add commit to PR or to close / reopen it. 要对travis配置应用上游更改,必​​须向PR添加提交或关闭/重新打开它。

  • If you've sent a pull request : You can close the PR then open it again . 如果您已发送拉取请求 :您可以关闭PR,然后再次打开它 This will trigger a new build. 这将触发一个新版本。

ButtonPicutre


#3楼

If you open the Settings tab for the repository on GitHub, click on Integrations & services , find Travis CI and click Edit , you should see a Test Service button. 如果打开GitHub上存储库的“设置”选项卡,请单击“ 集成和服务” ,找到Travis CI ,然后单击“ 编辑” ,您应该会看到一个“ 测试服务”按钮。 This will trigger a build. 这将触发构建。


#4楼

Log in to Travis and go to the build page. 登录到Travis并转到构建页面。 You will see a "Restart Build" button on the top-right corner, next to the gear icon: 您将在齿轮图标旁边的右上角看到“重新启动构建”按钮:

屏幕抓图

Note: you need to have write access to the linked GitHub repo for this to work. 注意:您需要对链接的GitHub存储库具有写权限,此功能才能起作用。


#5楼

如果构建从未发生(也许您没有及时将Pull-Request构建开关设置为打开),则可以在Github上将Pull Request标记为已关闭,然后将其标记为已打开,然后将触发新的构建。


#6楼

If you install the Travis CI Client you can use travis restart <job#> to manually re-run a build from the console. 如果安装Travis CI Client ,则可以使用travis restart <job#>从控制台手动重新运行构建。 You can find the last job# for a branch using travis show <branch> 您可以使用travis show <branch>找到分支的最后一个作业#

travis show master
travis restart 48 #use Job number without .1
travis logs master

Travis CI客户

UPDATE: Sadly it looks like this doesn't start a new build using the latest commit, but instead just restarts a previous build using the previous state of the repo. 更新:可悲的是,这看起来似乎并没有使用最新的提交来启动新的构建,而只是使用仓库的先前状态重新启动了先前的构建。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值