forked from jupyterhub/zero-to-jupyterhub-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52877eb
commit 2cf91ac
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,7 @@ jobs: | |
run: | | ||
. ./ci/common | ||
UPGRADE_FROM_VERSION=$(curl -sS https://jupyterhub.github.io/helm-chart/info.json | jq -er '.jupyterhub.${{ matrix.upgrade-from }}') | ||
echo "UPGRADE_FROM_VERSION=$UPGRADE_FROM_VERSION" >> $GITHUB_ENV | ||
echo "" | ||
echo "Installing already released jupyterhub version $UPGRADE_FROM_VERSION" | ||
|
@@ -157,14 +158,26 @@ jobs: | |
echo "Installing Helm diff plugin while k8s resources are initializing" | ||
helm plugin install https://github.com/databus23/helm-diff | ||
# ref: https://github.com/jacobtomlinson/gha-read-helm-chart | ||
- name: Load local Chart.yaml | ||
id: chart | ||
uses: jacobtomlinson/[email protected] | ||
with: | ||
path: jupyterhub | ||
|
||
- name: "Helm diff ${{ matrix.upgrade-from }} chart with current chart" | ||
if: matrix.test == 'upgrade' | ||
run: | | ||
# FIXME: consider if there is a way we can avoid being cluttered with | ||
# changes to the "chart" label defined in _helpers.tpl | ||
# "jupyterhub.commonLabels" named template. | ||
export STRING_REPLACER_A=${{ steps.chart.outputs.version }} | ||
export STRING_REPLACER_B=$UPGRADE_FROM_VERSION | ||
echo "NOTE: For the helm diff only, we have replaced the new chart" | ||
echo " version with the old chart version to reduce clutter." | ||
echo | ||
helm diff upgrade --install jupyterhub ./jupyterhub --values dev-config.yaml \ | ||
--context 3 | ||
--context=3 \ | ||
--post-renderer=ci/string-replacer.sh | ||
- name: "Await ${{ matrix.upgrade-from }} chart" | ||
if: matrix.test == 'upgrade' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# | ||
# In .github/workflows/test-chart.yaml, we test upgrading one chart version to | ||
# another. After having installed the first version we run "helm diff" with the | ||
# new version. | ||
# | ||
# This script created to be referenced by helm's --post-renderer flag to replace | ||
# strings in the rendered templates into something that doesn't change. | ||
# | ||
|
||
set -eu | ||
sed -e "s|$STRING_REPLACER_A|$STRING_REPLACER_B|" < /dev/stdin |