Python CLI用于管理Helm Chart依赖项
项目描述
helm-upgrade
你是否管理一个依赖于其他Helm Charts的Helm Chart?你是否厌倦了手动更新这些依赖项?那么这个工具就是为你准备的!helm-upgrade是一个Python命令行界面(CLI),可以自动更新本地Helm Charts的依赖项。
这个工具受到了bump-helm-deps-action的启发。
目录
:rocket: 安装
建议使用Python 3.8与该工具一起使用。
:snake: pip
pip install helm-upgrade
:wrench: 手动
首先,克隆此存储库并将其切换到它。
git clone https://github.com/sgibson91/helm-upgrade.git
cd helm-upgrade
使用Python安装需求和包。建议使用Python 3.8。
python -m pip install .
通过调用帮助页面来测试安装。
helm-upgrade --help
:recycle: 使用
usage: helm-upgrade [-h] [--dry-run] chart_path dependencies
Update the dependencies of a local Helm Chart in a project repository.
positional arguments:
  chart_path    Path to the file containing the dependencies of the local Helm Chart to
                be updated.
  dependencies  A dictionary of Helm Chart dependencies and their host repo URLs. E.g.
                '{"nginx-ingress":
                "https://raw.githubusercontent.com/helm/charts/master/stable/nginx-
                ingress/Chart.yaml"}'
optional arguments:
  -h, --help    show this help message and exit
  --dry-run     Perform a dry run of the update. Don't write the changes to a file.
helm-upgrade将
- 从您指定的文件中读取当前依赖项的版本,
- 从提供的URL(在JSON模式中)查找您想要的依赖项的最新版本(作为dependencies参数),
- 比较这些版本是否相等,
- 如果版本不相等(并且未设置--dry-run标志),则您的Helm Chart依赖项将被新的图表版本覆盖。
:wheel_of_dharma: 远程Helm Charts
helm-upgrade目前识别来自三种类型的主机上的图表版本。
- 
另一个GitHub存储库中的 Chart.yaml文件。这些URL以"/Chart.yaml"结尾。例如,https://raw.githubusercontent.com/helm/charts/master/stable/nginx-ingress/Chart.yaml 
- 
GitHub pages上托管的图表版本库。这些URL包含" /gh-pages/"。例如,https://raw.githubusercontent.com/jupyterhub/helm-chart/gh-pages/index.yaml 
- 
GitHub发布页面上的版本列表。这些URL以" /releases/latest"结尾,并使用BeautifulSoup来搜索html。
:white_check_mark: 运行测试
要运行测试套件,您必须首先遵循手动安装说明。完成后,可以按以下方式运行测试套件
python -m pytest -vvv
要查看测试套件的代码覆盖率,请运行以下命令
python -m coverage run -m pytest -vvv
coverage report
可以通过运行以下命令访问报告的交互式HTML版本
coverage html
然后在浏览器窗口中打开htmlcov/index.html文件。
:sparkles: 贡献
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
构建分发
helm-upgrade-0.1.1.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 2ea8b6a90398d843cec9fc2bbc06295380ba11bd6efc9f6808c4050474b6110a | |
| MD5 | 773c6880c1f4aa0c19fee845246b7114 | |
| BLAKE2b-256 | b5c649091d2b35b081237e10402eeee56c64e35e6b51387469028c3394600fb4 | 
helm_upgrade-0.1.1-py3-none-any.whl的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | a9dbc23c106033137123c2725efc03c9143a08fe5791c2f95790bcce7fc507a2 | |
| MD5 | 60139c18bc3cfd29ef37e26f05a5f9d0 | |
| BLAKE2b-256 | 071e07e25a40b360cc6d8a7f1b3ccde7eceb21970ba6c6c54143511c0a47cb83 |