当前位置:   article > 正文

如何使用 API 删除极狐GitLab 某个 tag 镜像?

如何使用 API 删除极狐GitLab 某个 tag 镜像?

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab :https://gitlab.cn/install?channel=content&utm_source=csdn 是 GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

极狐GitLab 在 5 月 28 日正式发布了 AI 产品驭码CodeRider。现已开启免费试用,登录官网:https://coderider.gitlab.cn/ 即可申请试用。

更多关于极狐GitLab :https://gitlab.cn 或者 DevOps 的最佳实践,可以关注文末的极狐GitLab 公众号。

学习极狐GitLab 的相关资料:

  1. 极狐GitLab 官网:https://gitlab.cn
  2. 极狐GitLab 官网文档:https://docs.gitlab.cn
  3. 极狐GitLab 论坛:https://forum.gitlab.cn/
  4. 极狐GitLab 安装配置:https://gitlab.cn/install
  5. 极狐GitLab 资源中心:https://resources.gitlab.cn/
  6. AI 产品驭码CodeRider:https://coderider.gitlab.cn/

搜索【极狐GitLab】公众号,后台输入加群,备注gitlab,即可加入官方微信技术交流群。

关联阅读

使用如下 API 即可:

DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name
  • 1

参数说明:

  • repository_id:镜像仓库 ID,如何使用 API 查看极狐GitLab 镜像仓库中的镜像的 535仓库为例。
  • tag_name:以 1.0.0为例。

执行如下命令:

curl --request DELETE --header "PRIVATE-TOKEN: YOUR-PERSONAL-ACCESS-TOKEN" \  "https://jihulab.com/api/v4/projects/16274/registry/repositories/535/tags/1.0.0"
  • 1

返回结果如下:

200
  • 1

只返回了一个 200 成功状态码。再用 list 镜像 tag 的 API GET /registry/repositories/:id来查看该 tag是否还存在:

curl --header "PRIVATE-TOKEN: YOUR-PERSONAL-ACCESS-TOKEN" \ "https://jihulab.com/api/v4/projects/16274/registry/repositories/535/tags"
  • 1

返回值为:

[]
  • 1

也就是说返回值为空。1.0.0 tag 被删除。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/885463
推荐阅读
相关标签
  

闽ICP备14008679号