处理gitlab ci构建变量的工具
gitlabbuildvariables的Python项目详细描述
Gitlab生成变量
处理gitlab ci管道生成变量的工具。
工具
管理多个项目
更新gitlab生成变量
基于配置文件设置项目生成变量:
gitlab-update-variables --url ${gitlabUrl} --token ${accessToken} --default-setting-extension ${extensions}\ --setting-repository ${repositoryDirectories} -- ${configLocation}
`有关如何 用这个工具!
管理单个项目
设置Gitlab生成变量
此工具允许从
ini配置文件、json文件或只是导出的shell脚本
变量:
gitlab-set-variables --url ${gitlabUrl} --token ${accessToken}${project}${locationOfVariables}
获取gitlab构建变量
gitlab-get-variables --url ${gitlabUrl} --token ${accessToken}${project}
设置Gitlab生成变量
此工具允许从 ini配置文件、json文件或只是导出的shell脚本 变量:
gitlab-set-variables --url ${gitlabUrl} --token ${accessToken}${project}${locationOfVariables}
获取gitlab构建变量
gitlab-get-variables --url ${gitlabUrl} --token ${accessToken}${project}
示例
示例1
使用example configuration更新 许多项目的变量:
$ exportgitlabUrl=https://gitlab.example.com $ exportaccessToken=personalAccessToken $ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} cn13/my-project-1 {'VALUE_1': 'other'} $ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} cn13/my-project-2 {} $ gitlab-update-variables --url ${gitlabUrl} --token ${accessToken} --default-setting-extension json ini sh \ --setting-repository examples/settings -- examples/config.json Read config from "examples/config.json" Set variables for"cn13/my-project-1": {'VALUE_1': 'abc', 'VALUE_2': 'other', 'VALUE_3': 'other'} Set variables for"cn13/my-project-2": {'VALUE_1': 'abc', 'VALUE_2': 'other', 'VALUE_3': 'ghi'}
示例2
使用the example directory中定义的设置更新项目变量:
$ exportgitlabUrl=https://gitlab.internal.example.com $ exportaccessToken=applicationAccessToken $ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} my-project {'VALUE_1': 'other'} $ gitlab-set-variables --url ${gitlabUrl} --token ${accessToken} group/my-project common.json s3.sh project.ini Variables for project "my-project"set to: {'VALUE_1': 'abc', 'VALUE_2': 'def', 'VALUE_3': 'ghi'}