-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tests_recycle
- Loading branch information
Showing
17 changed files
with
294 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
owner: grafana | ||
git-repo: helm-charts | ||
skip-existing: true |
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 @@ | ||
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md | ||
remote: origin | ||
target-branch: main | ||
chart-dirs: | ||
- charts | ||
chart-repos: | ||
- grafana=https://grafana.github.io/helm-charts | ||
validate-chart-schema: true | ||
validate-maintainers: true | ||
validate-yaml: true | ||
exclude-deprecated: true | ||
excluded-charts: [] |
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,149 @@ | ||
name: Release Helm chart | ||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
CR_CONFIGFILE: "${{ github.workspace }}/source/.github/configs/cr.yml" | ||
CT_CONFIGFILE: "${{ github.workspace }}/source/.github/configs/ct.yml" | ||
CR_INDEX_PATH: "${{ github.workspace }}/.cr-index" | ||
CR_PACKAGE_PATH: "${{ github.workspace }}/.cr-release-packages" | ||
CR_TOOL_PATH: "${{ github.workspace }}/.cr-tool" | ||
CR_VERSION: "1.5.0" | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changed: ${{ steps.list-changed.outputs.changed }} | ||
chartpath: ${{ steps.list-changed.outputs.chartpath }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: source | ||
|
||
- name: Install chart-testing | ||
uses: helm/chart-testing-action@v2 | ||
|
||
- name: List changed charts | ||
id: list-changed | ||
run: | | ||
cd source | ||
latest_tag=$( if ! git describe --tags --abbrev=0 --match='helm-chart/*' 2> /dev/null ; then git rev-list --max-parents=0 --first-parent HEAD; fi ) | ||
echo "Running: ct list-changed --config ${CT_CONFIGFILE} --since ${latest_tag} --target-branch ${{ github.ref_name }}" | ||
changed=$(ct list-changed --config "${CT_CONFIGFILE}" --since "${latest_tag}" --target-branch "${{ github.ref_name }}") | ||
echo "${changed}" | ||
num_changed=$(wc -l <<< ${changed}) | ||
if [[ "${num_changed}" -gt "1" ]] ; then | ||
echo "More than one chart changed, exiting" | ||
exit 1 | ||
fi | ||
if [[ -n "${changed}" ]]; then | ||
name=$(yq ".name" < ${changed}/Chart.yaml) | ||
version=$(yq ".version" < ${changed}/Chart.yaml) | ||
tagname="v${version}" | ||
if [ $(git tag -l "${tagname}") ]; then | ||
echo "Tag ${tagname} already exists, skipping release" | ||
echo "changed=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "Releasing ${changed}" | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
echo "chartpath=${changed}" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "No charts have changed, skipping release" | ||
echo "changed=false" >> $GITHUB_OUTPUT | ||
fi | ||
release: | ||
needs: [setup] | ||
runs-on: ubuntu-latest | ||
if: needs.setup.outputs.changed == 'true' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: source | ||
|
||
- name: Configure Git | ||
run: | | ||
cd source | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Checkout helm-charts | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
repository: grafana/helm-charts | ||
path: helm-charts | ||
token: "${{ secrets.GH_BOT_ACCESS_TOKEN }}" | ||
|
||
- name: Configure Git for helm-charts | ||
run: | | ||
cd helm-charts | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Parse Chart.yaml | ||
id: parse-chart | ||
run: | | ||
cd source | ||
changed="${{ needs.setup.outputs.chartpath }}" | ||
description=$(yq ".description" < ${changed}/Chart.yaml) | ||
name=$(yq ".name" < ${changed}/Chart.yaml) | ||
version=$(yq ".version" < ${changed}/Chart.yaml) | ||
echo "chartpath=${changed}" >> $GITHUB_OUTPUT | ||
echo "desc=${description}" >> $GITHUB_OUTPUT | ||
echo "tagname=v${version}" >> $GITHUB_OUTPUT | ||
echo "packagename=${name}-${version}" >> $GITHUB_OUTPUT | ||
- name: Install CR tool | ||
run: | | ||
mkdir "${CR_TOOL_PATH}" | ||
mkdir "${CR_PACKAGE_PATH}" | ||
mkdir "${CR_INDEX_PATH}" | ||
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v${CR_VERSION}/chart-releaser_${CR_VERSION}_linux_amd64.tar.gz" | ||
tar -xzf cr.tar.gz -C "${CR_TOOL_PATH}" | ||
rm -f cr.tar.gz | ||
- name: Create Helm package | ||
run: | | ||
cd source | ||
helm repo add grafana https://grafana.github.io/helm-charts | ||
"${CR_TOOL_PATH}/cr" package "${{ steps.parse-chart.outputs.chartpath }}" --config "${CR_CONFIGFILE}" --package-path "${CR_PACKAGE_PATH}" | ||
# Note that this creates a release in grafana/helm-charts with a new tag. | ||
# The tag name in grafana/helm-charts is <package>-<version> | ||
- name: Make release on Helm Charts | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ steps.parse-chart.outputs.packagename }} | ||
repository: grafana/helm-charts | ||
tag_name: ${{ steps.parse-chart.outputs.packagename }} | ||
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }} | ||
body: | | ||
${{ steps.parse-chart.outputs.desc }} | ||
Source commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
Tag on source: https://github.com/${{ github.repository }}/releases/tag/${{ steps.parse-chart.outputs.tagname }} | ||
files: | | ||
${{ env.CR_PACKAGE_PATH }}/${{ steps.parse-chart.outputs.packagename }}.tgz | ||
- name: Update helm-charts index.yaml | ||
run: | | ||
cd helm-charts | ||
"${CR_TOOL_PATH}/cr" index --config "${CR_CONFIGFILE}" --token "${{ secrets.GH_BOT_ACCESS_TOKEN }}" --index-path "${CR_INDEX_PATH}" --package-path "${CR_PACKAGE_PATH}" --push |
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,65 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
|
||
workflow_call: | ||
inputs: | ||
filter_regex_include: | ||
description: this sets the scope of the super linter | ||
default: ".*" | ||
required: false | ||
type: string | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
CT_CONFIGFILE: "${{ github.workspace }}/.github/configs/ct.yml" | ||
|
||
jobs: | ||
lint-helm-chart: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # required for chart-testing to work | ||
|
||
- name: Regenerate docs | ||
run: | | ||
docker run --rm \ | ||
-v "$(pwd)/deployments/helm:/helm-docs" \ | ||
-u "$(id -u)" \ | ||
jnorwood/helm-docs | ||
if ! git diff --exit-code; then | ||
echo "Helm chart documentation is not up to date. Please run 'helm-docs' and commit changes!" >&2 | ||
exit 1 | ||
fi | ||
- name: Lint Code Base with super-linter | ||
uses: docker://github/super-linter:v3.12.0 | ||
env: | ||
FILTER_REGEX_EXCLUDE: .*(README\.md|Chart\.yaml|NOTES.txt).* | ||
FILTER_REGEX_INCLUDE: ${{ inputs.filter_regex_include }} | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_KUBERNETES_KUBEVAL: false | ||
VALIDATE_YAML: false | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Linting with chart-testing | ||
uses: helm/chart-testing-action@v2.1.0 | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config "${CT_CONFIGFILE}") | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Linting with chart-testing | ||
run: ct lint --config "${CT_CONFIGFILE}" |
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,7 @@ | ||
# Contributing to Beyla helm chart | ||
|
||
To make sure that the helm docs are properly generated, run this after your changes: | ||
|
||
``` | ||
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.13.1 | ||
``` |
File renamed without changes.
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,21 @@ | ||
apiVersion: v2 | ||
name: beyla | ||
version: 1.0.0 | ||
appVersion: 1.5.2 | ||
description: eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. | ||
home: https://grafana.com/oss/beyla-ebpf/ | ||
icon: https://grafana.com/static/img/logos/beyla-logo.svg | ||
sources: | ||
- https://github.com/grafana/beyla | ||
type: application | ||
keywords: | ||
- observability | ||
- autoinstrumentation | ||
- eBPF-based | ||
maintainers: | ||
- name: mariomac | ||
url: https://github.com/mariomac | ||
- name: grcevski | ||
url: https://github.com/grcevski | ||
- name: marctc | ||
url: https://github.com/marctc |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -55,4 +55,4 @@ spec: | |
{{- end }} | ||
selector: | ||
{{- include "beyla.selectorLabels" . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
File renamed without changes.
Oops, something went wrong.