删除或重置Gitlab CI版本 [英] Delete or reset Gitlab CI builds

查看:371
本文介绍了删除或重置Gitlab CI版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Gitlab CI中删除旧版本? 我测试了几件事,现在大约有20个没用的构建(无论如何大多数都失败了). 它还显示了我不再需要的阶段,这使管道"页面有些混乱,并且某些上传的工件有些大.

Is it possible to delete old builds in Gitlab CI? I tested a few things and have now about 20 builds that are useless (most are failed anyway). It also shows stages that I don't have anymore which kinda clutters the Pipelines page and some of the uploaded artifacts are a bit big.

我找不到任何文档,只是在设置中禁用CI不会删除构建.

I wasn't able to find any documentation on this, only that disabling CI in the settings doesn't remove the builds.

使用Gitlab 8.10社区(由Gitlab.com托管)

Using Gitlab 8.10 Community (hosted by Gitlab.com)

推荐答案

除了从构建中删除相关数据外,GUI中目前没有其他选项可以完全摆脱构建. (构建中的擦除"选项)

There is currently no option in the GUI to completely get rid of a build other than expunge related data from the build. (The erase option in the build)

如果您将进行本地安装,则可以直接修改数据库,但是我建议您谨慎使用. (为了完整起见,我将指南放在这里)

If you would have a local installation you could modify the database directly but I would advise caution. (I'll put the guide here for completeness sake)

  1. 登录到GitLab数据库.如果您使用默认的PostgreSQL:

  1. Login to the GitLab database. If you use the default PostgreSQL :

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production

  • 检查是否有表ci_builds.对于pSQL:\dt

  • Check if there is a table ci_builds. For pSQL: \dt

    使用常规SQL删除版本.例如:DELETE FROM ci_builds WHERE id = 2

    Delete the builds with normal SQL. For example: DELETE FROM ci_builds WHERE id = 2

    (可选),如果要清除触发构建的提交列表,则需要对表ci_commits进行中间处理.

    (Optional) If you want to cleanup a list of commits which triggered a build you need to midify the table ci_commits.

    这篇关于删除或重置Gitlab CI版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆