35

This is my first day using Travis CI. I made some mistakes, I've tried removing and adding the repository again, but Travis CI build history is still there, with broken links for old commits.

Any chance to remove those old builds?

gremo
  • 47,186
  • 75
  • 257
  • 421

7 Answers7

38

You can use the travis command line tool

Login first using travis login then you can do the following

LAST_BUILD_NUMBER=68
for i in $(seq 1 $LAST_BUILD_NUMBER ); do  travis logs $i --delete --force ; done

This will remove the "logs" so there's no information aside from the header and any confidential information will no longer be visible.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
25

There's no way for the user to remove builds, but if you really want them removed I think your best bet is to email support (support@travis-ci.org) and ask them to remove it manually.

sarahhodne
  • 9,796
  • 3
  • 39
  • 44
  • 1
    Ok, thanks. It's just for consistency, but really there is no need to contact the support! – gremo Dec 14 '12 at 22:17
9

Per https://twitter.com/travisci/status/557932883571392512

Since at least 2015/01/21 you can now delete [the log] from the web UI:

travis web ui remove log

swooby
  • 3,005
  • 2
  • 36
  • 43
6

As henrikhodne, build deletion is not possible.

From https://github.com/travis-ci/travis-ci/issues/877 (mirror) where the issue was raised:

Closing this issue for good, as this isn't on the roadmap for the near future. (Jul 23, 2015)

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
5

You can click on the Remove log button

Screenshot

Sam Denty
  • 3,693
  • 3
  • 30
  • 43
5

Another way to PURGE EVERYTHING which results in:

  • removing all the build history from Travis CI
  • removing the repo from Travis CI
  • removing the repo data from GitHub (all issues, PRs, wiki, everything)
  • removing all the dangling commits from git push -f

First make sure you have screenshots/backups/... of all your settings in Travis and in remote repository + that you have a 1to1 mirror of your remote repository (meaning ALL your branches properly downloaded to the local repo). That should be possible just with git clone, git fetch and maybe even git checkout to each of the branches, so that you have all the history available locally (correct me if I forget some step).

Then you want to go to your remote server e.g. GitHub and delete the repository (Settings - Danger Zone - Delete this repository). All your issues, PRs, wikis, any settings are gone now. Then create the same-named repository on GitHub again (do NOT! initialize it with anything, no license, no readme, no nothing).

Now all the dangling commits which would be cleaned locally via git gc are gone from the remote repo (stealthy GitHub links begone!). Anything that should be the bare repo.git folder should be overwritten (unless GitHub isn't doing something silly).

Proceed and go to Travis CI profile:

https://travis-ci.org/profile/<username>

Press Sync account under My account and check the Travis repo. All the settings and build history should be gone now too.

Now either remove the GitHub repo and resync again or proceed with the restoring:

git push -u origin <branch name>  # repeat for each branch

Go to your settings backups (e.g. screenshots) and set everything the way it was before.

Peter Badida
  • 11,310
  • 10
  • 44
  • 90
  • 1
    This worked for me. However, it seemed it was necessary for me to run "Sync Account" *before* re-forking it from the base repo (to register the deletion from GitHub), and then re-fork it and run "Sync Account" again to pick up the new changes. – Fr Jeremy Krieg Feb 12 '19 at 02:17
  • This also worked for me. I had to fiddle with a few things here and there but nothing a little poking around didn't fix. Thanks for this @KeyWeeUsr! – jrnxf Sep 09 '19 at 05:30
1

I was able to wipe the Travis build history simply.

I'm logging into to travis-ci.org via my Github account.

I went into travis-ci-org, and hit the + to show all repositories:

go to repos

Then I turned off Travis CI for the repo in question by flipping this toggle:

enter image description here

In Github, I renamed my repo.

Then I hit "Sync account" in the upper left.

Sync account

For my final step, I flipped that toggle back on under the new repo name.

Voila - no Travis history. I triggered a build manually and now everything is clean and clear.

Mental Nomad
  • 343
  • 2
  • 6