This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removal of artisian python scripts * introduction if chart-testing tool * improvement in shellcheck make target * simplification of Makefile Signed-off-by: Paweł Krupa (paulfantom) <[email protected]>
- Loading branch information
1 parent
f6f09ff
commit c216dfa
Showing
13 changed files
with
236 additions
and
143 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Test Helm Charts" | ||
name: "Test [old]" | ||
on: | ||
- push | ||
- pull_request | ||
|
@@ -7,29 +7,6 @@ env: | |
helm-version: v3.8.1 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Copy example values files to the expected Helm Linter locations | ||
run: make refresh-ci-values | ||
|
||
- name: Run linter on Helm Charts | ||
id: lint | ||
uses: helm/[email protected] | ||
with: | ||
command: lint | ||
|
||
- name: Install shellcheck | ||
run: sudo apt-get install shellcheck | ||
|
||
- name: Run shellcheck on all scripts | ||
run: make shellcheck | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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,91 @@ | ||
name: "Test Helm Charts" | ||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
go-version: 1.19.0 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
|
||
- name: Install gojsontoyaml | ||
run: go install github.com/brancz/gojsontoyaml@latest | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (lint) | ||
run: make lint | ||
|
||
- name: Run shellcheck | ||
run: make shellcheck | ||
|
||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
|
||
- name: Install gojsontoyaml | ||
run: go install github.com/brancz/gojsontoyaml@latest | ||
|
||
- name: Generate JSON Schema | ||
run: make json-schema && git diff --exit-code | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
kube: | ||
- "1.23" | ||
- "1.24" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Start kuberenetes cluster | ||
env: | ||
KUBE_VERSION: ${{ matrix.kube }} | ||
run: | | ||
make start-kind | ||
- name: Wait for cluster to finish bootstraping | ||
run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s | ||
|
||
- name: Run e2e chart-testing | ||
run: make e2e | ||
|
||
test-result: | ||
name: End-to-End Test Results | ||
if: always() | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark the job as a success | ||
if: needs.test.result == 'success' | ||
run: exit 0 | ||
- name: Mark the job as a failure | ||
if: needs.test.result != 'success' | ||
run: exit 1 |
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
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
This file was deleted.
Oops, something went wrong.
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
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,20 @@ | ||
#!/bin/bash | ||
|
||
# Set this after CI detection to prevent "unbound variable" error | ||
set -euo pipefail | ||
|
||
cd "$(git rev-parse --show-toplevel)" | ||
|
||
TMP_DIR=tmp | ||
|
||
SINGLE_VALUES_FILES="charts/timescaledb-single/values.yaml $(ls charts/timescaledb-single/ci/*.yaml)" | ||
|
||
for vfile in $SINGLE_VALUES_FILES; do \ | ||
scripts_dir="${TMP_DIR}/$(basename "${vfile}")" | ||
mkdir -p "${scripts_dir}"; \ | ||
helm template charts/timescaledb-single -s templates/configmap-scripts.yaml -f "${vfile}" | gojsontoyaml -yamltojson > "${scripts_dir}/temp.json" | ||
for script in $(jq '.data | keys | sort | .[]' -r "${scripts_dir}/temp.json"); do | ||
echo "Extracting script: ${vfile} / ${script}" | ||
jq -r --arg script "${script}" '.data[$script]' "${scripts_dir}/temp.json" > "${scripts_dir}/${script}" | ||
done | ||
done |
Oops, something went wrong.