“获取片段到本地文件”
项目描述
该工具用于从 Gitlab 下载片段到本地文件。
它主要用于 Gitlab CI/CD 管道,但可以在其他地方用作独立工具。在管道中使用时,–gl-url`、–proj_id 和token已经由 Gitlab 定义。
安装
来自皮皮:
pip install gl-snippet
用法
Usage: gl-snippet [OPTIONS] SNIP_ID TARGET
Fetch a snippet contents from Gitlab.
This is used to fetch the contents of a snippet and save it to a file.
Note that the snippet must be a single-file snippet. Gitlab supports
snippets with multiple files (but their python-gitlab API doesn't really
handle multi-file snippets very well.)
The parameters --gl-url, --proj_id and --token may be specified directly
or as environment variables. These use the standard Gitlab CI/CD pipeline
variables.
A use-case for this is to store the contents for .pypirc or pip.conf in a
snippet to fetch for a Gitlab pipeline step.
Options:
--gl-url TEXT URL to Gitlab server (CI_SERVER_URL)
--proj_id INTEGER Project ID (CI_PROJECT_ID)
-t, --token TEXT API access token (CI_JOB_TOKEN)
--help Show this message and exit.
Gitlab 中的每个片段都需要是一个单文件片段(由于 gitlab-python片段 API 的工作方式有限)。片段可能是“全局”或项目片段。从 Gitlab 管道供应中访问“全局”片段--proj_id ""
来自.gitlab-ci.yml 的示例:
before_script:
- pip install gl-snippet
- gl-snippet 25 ~/.pypirc
桌面示例:
$ pip install gl-snippet
$ gl-snippet --gl-url https://gitlab.com --proj_id 529 --token <your_api_token> 25 ~/.pypirc
发行说明
0.1.6.0
构建为“通用”
0.1.5.0
如果尚未创建,则创建目标目录
对于“全局”片段,默认--proj_id为 0
项目详情
关
gl_snippet -0.1.7.0-py2.py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 90ea068df1a5beeae10d1047d4ae4b0f9396408bd4805238421ba7cf2f3bcc42 |
|
| MD5 | a7dfa3d1e7908e1a6067c49123f0e0a9 |
|
| 布莱克2-256 | 53fcd3a94f294c62af7bc912377bdc87e8c86438cc2ec0d2cef8904f74bbba8d |