Trigger a Travis-CI rebuild without pushing a commit?

后端 未结 16 2131
长发绾君心
长发绾君心 2020-12-12 08:21

Using Travis-CI, is it possible to trigger a rebuild without pushing a new commit to GitHub?

Use case: A build fails due to an externality. The source is actually co

相关标签:
16条回答
  • 2020-12-12 09:17
    • If you have write access to the repo: On the build's detail screen, there is a button ↻ Restart Build. Also under "More Options" there is a trigger build menu item.

      Note: Browser extensions like Ghostery may prevent the restart button from being displayed. Try disabling the extension or white-listing Travis CI.

      Note2: If .travis.yml configuration has changed in the upstream, clicking rebuild button will run travis with old configuration. To apply upstream changes for travis configuration one has to add commit to PR or to close / reopen it.

    • If you've sent a pull request: You can close the PR then open it again. This will trigger a new build.

    Restart Build:

    Trigger Build:

    0 讨论(0)
  • 2020-12-12 09:18

    If you install the Travis CI Client you can use travis restart <job#> to manually re-run a build from the console. You can find the last job# for a branch using travis show <branch>

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

    Travis CI Client

    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)
  • 2020-12-12 09:19

    Log in to Travis and go to the build page. You will see a "Restart Build" button on the top-right corner, next to the gear icon:

    screengrab

    Note: you need to have write access to the linked GitHub repo for this to work.

    0 讨论(0)
  • 2020-12-12 09:20

    If you have new project on GitHub which has .travis.yml, but was never tested, you can run tests without commit this way:

    1. enable testing in Travis CI setings
    2. open project page on GitHub
    3. open settings -> webhooks and services
    4. find Travis CI in services and press edit button
    5. press "Test service"
    0 讨论(0)
提交回复
热议问题