Delete or reset Gitlab CI builds

后端 未结 1 414
青春惊慌失措
青春惊慌失措 2021-02-07 04:06

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\'

相关标签:
1条回答
  • 2021-02-07 05:11

    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. 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
      
    2. Check if there is a table ci_builds. For pSQL: \dt

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

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

    0 讨论(0)
提交回复
热议问题