From 845ecd2231e4668e75f7270e70a451e0c8375ccc Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Fri, 1 Apr 2022 11:45:11 +0200 Subject: [PATCH] feat(ci): split-off helm-prep and precommit --- .github/scripts/gen-docs.sh | 23 ----------------------- .github/workflows/charts-release.yaml | 22 ++++++++++++++++++++++ charts/dependency/promtail/Chart.yaml | 2 +- tools/build-release.sh | 4 ++-- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/scripts/gen-docs.sh b/.github/scripts/gen-docs.sh index 440a13d60bd..edb57fc8368 100755 --- a/.github/scripts/gen-docs.sh +++ b/.github/scripts/gen-docs.sh @@ -24,19 +24,6 @@ chart_runner(){ } export -f chart_runner -prep_helm() { - helm repo add truecharts-old https://truecharts.org - helm repo add truecharts https://charts.truecharts.org - helm repo add truecharts-library https://library-charts.truecharts.org - helm repo add bitnami https://charts.bitnami.com/bitnami - helm repo add metallb https://metallb.github.io/metallb - helm repo add grafana https://grafana.github.io/helm-charts - helm repo add prometheus https://prometheus-community.github.io/helm-charts - helm repo add amd-gpu-helm https://radeonopencompute.github.io/k8s-device-plugin/ - helm repo update - } -export -f prep_helm - # Designed to ensure the appversion in Chart.yaml is in sync with the primary App tag if found sync_tag() { local chart="$1" @@ -118,14 +105,6 @@ sec_scan_cleanup() { } export -f sec_scan_cleanup -pre_commit() { - echo "Running pre-commit test-and-cleanup..." - pre-commit run --all ||: - # Fix sh files to always be executable - find . -name '*.sh' | xargs chmod +x - } - export -f pre_commit - create_changelog() { local chart="$1" local chartname="$2" @@ -174,7 +153,5 @@ generate_docs() { export -f generate_docs parthreads=$(($(nproc) * 2)) -prep_helm parallel -j ${parthreads} chart_runner '2>&1' ::: ${1} echo "Starting post-processing" -pre_commit diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index 93403bc3fab..910cf3dcf33 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -29,6 +29,18 @@ jobs: wget -O /tmp/helm-docs.deb https://github.com/k8s-at-home/helm-docs/releases/download/v0.1.1/helm-docs_0.1.1_Linux_x86_64.deb sudo dpkg -i /tmp/helm-docs.deb + - name: Prep Helm + run: | + helm repo add truecharts-old https://truecharts.org + helm repo add truecharts https://charts.truecharts.org + helm repo add truecharts-library https://library-charts.truecharts.org + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add metallb https://metallb.github.io/metallb + helm repo add grafana https://grafana.github.io/helm-charts + helm repo add prometheus https://prometheus-community.github.io/helm-charts + helm repo add amd-gpu-helm https://radeonopencompute.github.io/k8s-device-plugin/ + helm repo update + - name: Checkout uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3 with: @@ -47,6 +59,16 @@ jobs: CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }}) .github/scripts/gen-docs.sh ${CHARTS} + - name: Fix Pre-Commit issues + shell: bash + if: | + steps.collect-changes.outputs.changesDetectedAfterTag == 'true' + run: | + echo "Running pre-commit test-and-cleanup..." + pre-commit run --all ||: + # Fix sh files to always be executable + find . -name '*.sh' | xargs chmod +x + - name: Checkout uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3 with: diff --git a/charts/dependency/promtail/Chart.yaml b/charts/dependency/promtail/Chart.yaml index f149197dfaa..f55f5579dc5 100644 --- a/charts/dependency/promtail/Chart.yaml +++ b/charts/dependency/promtail/Chart.yaml @@ -22,7 +22,7 @@ sources: - https://grafana.com/oss/loki/ - https://grafana.com/docs/loki/latest/ type: application -version: 2.0.16 +version: 2.0.17 annotations: truecharts.org/catagories: | - metrics diff --git a/tools/build-release.sh b/tools/build-release.sh index 3f515316c63..aec3f35adaf 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -52,11 +52,11 @@ main() { # copy_general_docs if [[ -n "${changed_charts[*]}" ]]; then - prep_helm + #prep_helm parallel -j ${parthreads} chart_runner '2>&1' ::: ${changed_charts[@]} echo "Starting post-processing" - pre_commit + #pre_commit validate_catalog if [ "${production}" == "true" ]; then gen_dh_cat