Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徐晓伟工作室
gitlab-go
提交
f3787e58
G
gitlab-go
项目概览
徐晓伟工作室
/
gitlab-go
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-go
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f3787e58
编写于
10月 15, 2023
作者:
徐晓伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
容器仓库 API: 删除仓库里存储库的某个标签
上级
44b13338
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
4 deletion
+32
-4
README.md
README.md
+5
-4
container_registry/container_registry.go
container_registry/container_registry.go
+27
-0
未找到文件。
README.md
浏览文件 @
f3787e58
...
...
@@ -231,10 +231,11 @@ COPYRIGHT:
gitlab-go container-registry command [command options] [arguments...]
COMMANDS:
list 列出仓库内存储库
list-tags 列出仓库里存储库的标签
get-tag 获取仓库里存储库的某个标签的详情
help, h Shows a list of commands or help for one command
list 列出仓库内存储库
list-tags 列出仓库里存储库的标签
get-tag 获取仓库里存储库的某个标签的详情
delete-tag, rm-tag 删除仓库里存储库的某个标签
help, h Shows a list of commands or help for one command
OPTIONS:
--base-url value 实例地址,例如:https://gitlab.xuxiaowei.com.cn/api/v4 (default: "https://gitlab.com/api/v4") [%CI_API_V4_URL%]
...
...
container_registry/container_registry.go
浏览文件 @
f3787e58
...
...
@@ -261,6 +261,33 @@ func ContainerRegistry() *cli.Command {
}
}
return
nil
},
},
{
Name
:
"delete-tag"
,
Aliases
:
[]
string
{
"rm-tag"
},
Usage
:
"删除仓库里存储库的某个标签"
,
Flags
:
append
(
flag
.
CommonTokenRequired
(),
flag
.
Id
(
true
),
flag
.
Repository
(
true
),
flag
.
TagName
(
true
)),
Action
:
func
(
context
*
cli
.
Context
)
error
{
var
baseUrl
=
context
.
String
(
constant
.
BaseUrl
)
var
token
=
context
.
String
(
constant
.
Token
)
var
id
=
context
.
String
(
constant
.
Id
)
var
repository
=
context
.
Int
(
constant
.
Repository
)
var
tagName
=
context
.
String
(
constant
.
TagName
)
gitClient
,
err
:=
gitlab
.
NewClient
(
token
,
gitlab
.
WithBaseURL
(
baseUrl
))
if
err
!=
nil
{
return
err
}
response
,
err
:=
gitClient
.
ContainerRegistry
.
DeleteRegistryRepositoryTag
(
id
,
repository
,
tagName
)
log
.
Printf
(
"Response StatusCode: %d
\n
"
,
response
.
Response
.
StatusCode
)
if
err
!=
nil
{
return
err
}
return
nil
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录