This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
TT-11837: deprecate helm charts (#303) #209
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
name: Lint and Test Charts | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
lint-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
k8s-version: ["v1.26.3","v1.25.2","v1.24.6","v1.23.12","v1.22.15","v1.21.14","v1.20.15"] | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.0.1 | |
with: | |
version: v3.3.0 | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --config ct.yaml --since HEAD~) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: Run chart-testing (lint) | |
run: ct lint --config ct.yaml --since HEAD~ | |
- name: Create kind cluster | |
uses: helm/kind-action@v1.4.0 | |
with: | |
config: .github/kind-cluster.yml | |
node-image: "kindest/node:${{ matrix.k8s }}" | |
if: steps.list-changed.outputs.changed == 'true' | |
- name: Check DASH_LICENSE secret expiry | |
run: jq -Re 'split(".")[1] | @base64d | fromjson | .exp > now' <<< "${{ secrets.DASH_LICENSE }}" | |
- name: Setup yq | |
run: sudo wget https://github.com/mikefarah/yq/releases/download/v4.6.3/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq | |
- name: Update Chart Dependencies and Values | |
run: | | |
changed_list=($(ct list-changed --config ct.yaml --since HEAD~)) | |
for chart in "${changed_list[@]}"; do | |
if [ "$chart" == "tyk-pro" ]; then | |
# Both MDCB and Dashbaord license keys will expire on 07-04-21 | |
yq eval '.dash.license = "${{ secrets.DASH_LICENSE }}"' -i tyk-pro/values.yaml | |
yq eval '.mdcb.license = "${{ secrets.MDCB_LICENSE }}"' -i tyk-pro/values.yaml | |
yq eval '.dependencies += [{"name": "simple-redis","version": "0.1.0","repository": "https://helm.tyk.io/public/helm/charts/"},{"name": "simple-mongodb","version": "0.1.0","repository": "https://helm.tyk.io/public/helm/charts/"}]' -i tyk-pro/Chart.yaml | |
elif [ "$chart" == "tyk-hybrid" ]; then | |
yq eval '.gateway.rpc.connString = "${{ secrets.HYBRID_MDCB_HOST }}"' -i tyk-hybrid/values.yaml | |
yq eval '.gateway.rpc.rpcKey = "${{ secrets.HYBRID_RPC_KEY }}"' -i tyk-hybrid/values.yaml | |
yq eval '.gateway.rpc.apiKey = "${{ secrets.HYBRID_API_KEY }}"' -i tyk-hybrid/values.yaml | |
yq eval '.dependencies += [{"name": "simple-redis","version": "0.1.0","repository": "https://helm.tyk.io/public/helm/charts/"}]' -i tyk-hybrid/Chart.yaml | |
else | |
yq eval '.dependencies += [{"name": "simple-redis","version": "0.1.0","repository": "https://helm.tyk.io/public/helm/charts/"},{"name": "simple-mongodb","version": "0.1.0","repository": "https://helm.tyk.io/public/helm/charts/"}]' -i tyk-headless/Chart.yaml | |
fi | |
done | |
- name: Run chart-testing (install) | |
run: ct install --config ct.yaml --since HEAD~ # Use --upgrade to test an in-place upgrade of each chart |