图表:渲染和发布头盔图表和图像
chartpress的Python项目详细描述
图表按
自动建立和发布头盔图表和相关图像。
这是作为jupyterhub和binder项目的一部分使用的。
图表出版社将:
- 生成Docker图像并用最新的Git提交标记它们
- 将这些图像发布到dockerhub
- 重新提交图表以包含标记的图像
- 将图表和索引发布到GH页
chartpress.yaml
文件包含要生成的图表和图像的规范。
例如:
charts:# list of charts by name# each name should be a directory containing a helm chart-name:binderhub# the prefix to use for built imagesimagePrefix:jupyterhub/k8s-# the git repo whose gh-pages contains the chartsrepo:git:jupyterhub/helm-chartpublished:https://jupyterhub.github.io/helm-chart# additional paths (if any) relevant to the chart version# outside the chart directory itselfpaths:-../setup.py-../binderhub# images to build for this chart (optional)images:binderhub:# Context to send to docker build for use by the Dockerfile# (if different from the current directory)contextPath:..# Dockerfile path, if different from the default# (may be needed if contextPath is set)dockerfilePath:images/binderhub/Dockerfile# path in values.yaml to be updated with image name and tagvaluesPath:image# additional paths (if any) relevant to the image# outside the image directory itselfpaths:-../setup.py-../binderhub
用法
在包含chartpress.yaml
的目录中,运行:
chartpress
建立图表和图像。添加--push
将图像发布到Docker Hub,添加--publish-chart
将图表和索引发布到GH页面。
usage: chartpress [-h] [--commit-range COMMIT_RANGE] [--push]
[--publish-chart] [--tag TAG]
[--extra-message EXTRA_MESSAGE]
Automate building and publishing helm charts and associated images. This is
used as part of the JupyterHub and Binder projects.
optional arguments:
-h, --help show this help message and exit
--commit-range COMMIT_RANGE
Range of commits to consider when building images
--push push built images to docker hub
--publish-chart publish updated chart to gh-pages
--tag TAG Use this tag for images & charts
--extra-message EXTRA_MESSAGE
extra message to add to the commit message when
publishing charts
注意事项
浅克隆
ChartPress在确定要用于图表和图像的标记时,会检测最新的更改目录或文件的提交。 这意味着不应使用浅层克隆,因为如果上次更改相关文件的提交超出浅层提交范围,则将分配错误的标记。
Travis默认使用50的克隆深度,这可能导致错误的图像标记。
你可以在你的.travis.yml
中disable this shallow clone behavior:
git:depth:false