From e8cab065eecaf1cacbfda3fbe106ffda259f81e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=99=93=E4=BC=9F?= Date: Thu, 5 Oct 2023 04:23:49 +0800 Subject: [PATCH] :memo: --- README.md | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 100 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 79b2f09..7e1492b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# GitLab Go +# GitLab Go 脚手架 ## 开发命令 @@ -36,28 +36,121 @@ go run main.go help ``` ```shell -$ go run main.go help +$ go run main.go --help NAME: - boom - make an explosive entrance + gitlab-go - 基于 Go 语言开发的 GitLab 命令行工具 USAGE: - boom [global options] command [command options] [arguments...] + gitlab-go [global options] command [command options] [arguments...] VERSION: - v0.0.1-snapshot + dev COMMANDS: - help, h Shows a list of commands or help for one command + projects, p 项目 API,中文文档:https://docs.gitlab.cn/jh/api/projects.html + pipelines, pl 流水线 API,中文文档:https://docs.gitlab.cn/jh/api/pipelines.html + jobs, j 作业 API,中文文档:https://docs.gitlab.cn/jh/api/jobs.html + job-artifacts, ja 作业产物 API,中文文档:https://docs.gitlab.cn/jh/api/job_artifacts.html + help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --help, -h show help --version, -v print the version ``` +- [projects - 项目 API](https://docs.gitlab.cn/jh/api/projects.html) + +```shell +$ go run main.go projects --help +NAME: + gitlab-go projects - 项目 API,中文文档:https://docs.gitlab.cn/jh/api/projects.html + +USAGE: + gitlab-go projects command [command options] [arguments...] + +COMMANDS: + list 列出所有项目 + 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%] + --token value your_access_token + --sort value 按照 asc 或者 desc 排序 (default: "desc") + --help, -h show help +``` + +- [pipelines - 流水线 API](https://docs.gitlab.cn/jh/api/pipelines.html) + +```shell +$ go run main.go pipelines --help +NAME: + gitlab-go pipelines - 流水线 API,中文文档:https://docs.gitlab.cn/jh/api/pipelines.html + +USAGE: + gitlab-go pipelines command [command options] [arguments...] + +COMMANDS: + list 列出项目流水线 + 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%] + --token value your_access_token + --sort value 按照 asc 或者 desc 排序 (default: "desc") + --id value 项目 ID 或 URL 编码的路径 + --help, -h show help +``` + +- [jobs - 作业 API](https://docs.gitlab.cn/jh/api/jobs.html) + +```shell +$ go run main.go jobs --help +NAME: + gitlab-go jobs - 作业 API,中文文档:https://docs.gitlab.cn/jh/api/jobs.html + +USAGE: + gitlab-go jobs command [command options] [arguments...] + +COMMANDS: + list 列出项目作业 + 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%] + --token value your_access_token + --sort value 按照 asc 或者 desc 排序 (default: "desc") + --help, -h show help +``` + +- [job-artifacts - 作业产物 API](https://docs.gitlab.cn/jh/api/job_artifacts.html) + +```shell +$ go run main.go job-artifacts --help +NAME: + gitlab-go job-artifacts - 作业产物 API,中文文档:https://docs.gitlab.cn/jh/api/job_artifacts.html + +USAGE: + gitlab-go job-artifacts command [command options] [arguments...] + +COMMANDS: + get 获取作业产物(未完成) + download, dl 下载产物归档文件(未完成) + delete, rm 删除作业产物 + delete-project, rm-p 删除项目产物 + 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%] + --token value your_access_token + --id value 项目 ID 或 URL 编码的路径 + --job-id value 作业 ID + --help, -h show help +``` + ### test ```shell -go test -v +go test ./... -v ``` ### build