Skip to content

Commit

Permalink
optimize helm release (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
samanhappy authored Mar 11, 2023
1 parent 80487c1 commit 8b36e44
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Helm Lint

on: pull_request

jobs:
helm-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.5.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ctconfig.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ctconfig.yaml

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install --config ctconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Release Helm Charts
name: Helm Release

on:
push:
branches:
- main
paths:
- "helm/**"

jobs:
release:
helm-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -31,3 +33,4 @@ jobs:
charts_dir: helm
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "easeprobe-helm-charts-v{{ .Version }}"
9 changes: 9 additions & 0 deletions ctconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: main
chart-dirs:
- helm
chart-repos:
- prometheus=https://prometheus-community.github.io/helm-charts
- grafana=https://grafana.github.io/helm-charts
helm-extra-args: --timeout 600s
4 changes: 2 additions & 2 deletions helm/easeprobe/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ annotations:
apiVersion: v2
appVersion: "2.0.0"
name: easeprobe
version: "0.0.1"
version: "1.0.0"
description: EaseProbe is a simple, standalone, and lightweight tool that can do health/status checking, written in Go
home: https://github.com/megaease/easeprobe
sources:
Expand All @@ -19,4 +19,4 @@ dependencies:
- name: grafana
version: 6.50.6
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
condition: grafana.enabled
4 changes: 2 additions & 2 deletions helm/easeprobe/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ prometheus:
enabled: false
prometheus-pushgateway:
enabled: false

## Refer https://artifacthub.io/packages/helm/grafana/grafana
grafana:
enabled: false
Expand All @@ -66,4 +66,4 @@ grafana:
- name: Prometheus
type: prometheus
url: "http://{{ .Release.Name }}-prometheus-server"
isDefault: true
isDefault: true

0 comments on commit 8b36e44

Please sign in to comment.