Skip to content

Commit

Permalink
Merge pull request #1 from timberio/migrate-vector-charts
Browse files Browse the repository at this point in the history
Initial update for Vector charts
  • Loading branch information
spencergilbert authored Aug 11, 2021
2 parents 2f43af8 + 67d3fbe commit 3a5bab2
Show file tree
Hide file tree
Showing 84 changed files with 3,230 additions and 520 deletions.
6 changes: 6 additions & 0 deletions .github/ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
chart-repos:
- timberio=https://packages.timber.io/helm/latest
- timberio-nightly=https://packages.timber.io/helm/nightly
check-version-increment: true
debug: true
helm-extra-args: --timeout 300s
25 changes: 25 additions & 0 deletions .github/kubeval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Credit: https://github.com/DataDog/helm-charts/blob/master/.github/kubeval.sh
set -euo pipefail

KUBEVAL_VERSION="0.16.1"
SCHEMA_LOCATION="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/" # Up-to-date fork of instrumenta/kubernetes-json-schema
OS=$(uname)

CHANGED_CHARTS=${CHANGED_CHARTS:-${1:-}}
if [ -n "$CHANGED_CHARTS" ];
then
CHART_DIRS=$CHANGED_CHARTS
else
CHART_DIRS=$(ls -d charts/*)
fi

# install kubeval
curl --silent --show-error --fail --location --output /tmp/kubeval.tar.gz https://github.com/instrumenta/kubeval/releases/download/v"${KUBEVAL_VERSION}"/kubeval-${OS}-amd64.tar.gz
tar -xf /tmp/kubeval.tar.gz kubeval

# validate charts
for CHART_DIR in ${CHART_DIRS}; do
echo "Running kubeval for folder: '$CHART_DIR'"
helm dep up "${CHART_DIR}" && helm template --values "${CHART_DIR}"/ci/kubeval.yaml "${CHART_DIR}" | ./kubeval --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}"
done
103 changes: 103 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Credit: https://github.com/DataDog/helm-charts/blob/master/.github/workflows/ci.yaml
name: Lint and Test Charts

on:
pull_request:
paths:
- 'charts/**'

jobs:
changed:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo -n "Charts changed:"
echo "$changed"
echo "::set-output name=changed::$changed"
else
echo "PR without any chart changes - failing"
exit 1
fi
lint-chart:
runs-on: ubuntu-latest
needs:
- changed
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint --config .github/ct.yaml

kubeval-chart:
runs-on: ubuntu-latest
needs:
- changed
strategy:
matrix:
# When changing versions here, check that the version exists at: https://github.com/yannh/kubernetes-json-schema and https://hub.docker.com/r/kindest/node/tags
k8s:
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.19
- v1.19.11
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add timberio helm repo
run: |
helm repo add timberio https://packages.timber.io/helm/latest
helm repo add timberio-nightly https://packages.timber.io/helm/nightly
helm repo update
- name: Run kubeval
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
CHANGED_CHARTS: ${{needs.changed.outputs.charts}}
run: .github/kubeval.sh

install-chart:
runs-on: ubuntu-latest
needs:
- lint-chart
- kubeval-chart
strategy:
matrix:
# When changing versions here, check that the version exists at: https://github.com/yannh/kubernetes-json-schema and https://hub.docker.com/r/kindest/node/tags
k8s:
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.19
- v1.19.11
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create kind ${{ matrix.k8s }}
uses: helm/kind-action@main
with:
node_image: kindest/node:${{ matrix.k8s }}
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (install)
run: ct install --config .github/ct.yaml --excluded-charts vector-shared
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Credit: https://github.com/DataDog/helm-charts/blob/master/.github/workflows/release.yaml
name: Release Charts

on:
push:
branches:
- master
paths:
- 'charts/**'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Add repo
run: |
helm repo add timberio https://packages.timber.io/helm/latest
helm repo add timberio-nightly https://packages.timber.io/helm/nightly
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
Loading

0 comments on commit 3a5bab2

Please sign in to comment.