From 8ad98238db73377d640c262d6d146b21b91102b7 Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Tue, 17 Nov 2020 02:35:47 +0100 Subject: [PATCH] Add githooks --- charts/openvpn-as/Chart.yaml | 2 +- charts/openvpn-as/README.md | 2 +- charts/openvpn-as/README.md.gotmpl | 7 +++---- docs/githooks.md | 23 +++++++++++++++++++++++ githooks/pre-commit/10-docs | 10 ++++++++++ githooks/pre-commit/20-lint | 4 ++++ githooks/pre-commit/30-template | 9 +++++++++ 7 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 docs/githooks.md create mode 100755 githooks/pre-commit/10-docs create mode 100755 githooks/pre-commit/20-lint create mode 100755 githooks/pre-commit/30-template diff --git a/charts/openvpn-as/Chart.yaml b/charts/openvpn-as/Chart.yaml index 6e373c1..d8cc18f 100644 --- a/charts/openvpn-as/Chart.yaml +++ b/charts/openvpn-as/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: openvpn-as description: A Helm chart for Kubernetes type: application -version: 0.1.4 +version: 0.1.5 appVersion: version-2.8.6-916f8e7d-ubuntu18 maintainers: - email: dries@stenic.io diff --git a/charts/openvpn-as/README.md b/charts/openvpn-as/README.md index 91f42d8..9bab258 100644 --- a/charts/openvpn-as/README.md +++ b/charts/openvpn-as/README.md @@ -86,7 +86,7 @@ The following tables list the configurable parameters of the openvpn-as chart an | securityContext.capabilities.add[0] | string | `"NET_ADMIN"` | | | service.admin.type | string | `"ClusterIP"` | | | service.gui.type | string | `"ClusterIP"` | | -| service.type | string | `"LoadBalancer"` | | +| service.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `true` | | | serviceAccount.name | string | `""` | | diff --git a/charts/openvpn-as/README.md.gotmpl b/charts/openvpn-as/README.md.gotmpl index 1ac4242..59fbe24 100644 --- a/charts/openvpn-as/README.md.gotmpl +++ b/charts/openvpn-as/README.md.gotmpl @@ -4,19 +4,18 @@ ```console helm repo add stenic https://stenic.github.io/helm-charts -helm install my-release stenic/{{ template "chart.name" . }} +helm install my-release --set "service.type=LoadBalancer" stenic/{{ template "chart.name" . }} ``` - ## Introduction This chart installs `{{ template "chart.name" . }}` on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - ## Prerequisites - Kubernetes 1.12+ - Helm 3.0+ +- LoadBalancer to expose the vpn service - PV provisioner support in the underlying infrastructure @@ -26,7 +25,7 @@ To install the chart with the release name `my-release`: ```console helm repo add stenic https://stenic.github.io/helm-charts -helm install my-release stenic/{{ template "chart.name" . }} +helm install my-release --set "service.type=LoadBalancer" stenic/{{ template "chart.name" . }} ``` These commands deploy {{ template "chart.name" . }} on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation. diff --git a/docs/githooks.md b/docs/githooks.md new file mode 100644 index 0000000..966408d --- /dev/null +++ b/docs/githooks.md @@ -0,0 +1,23 @@ +# Githooks + +This project takes advantange of [git-hooks](https://github.com/git-hooks/git-hooks) to ensure code quality. + +Whenever a commit is done, some quick and basic validations will be performed. +See the `githooks` folder for more info. + +## Requirements + + - [helm-docs](https://github.com/norwoodj/helm-docs) + +## Installation + +```bash +brew install norwoodj/tap/helm-docs +brew install git-hooks-go +``` + +## Enable + +```bash +git hook install +``` diff --git a/githooks/pre-commit/10-docs b/githooks/pre-commit/10-docs new file mode 100755 index 0000000..178a219 --- /dev/null +++ b/githooks/pre-commit/10-docs @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +echo "==> Generating docs..." +helm-docs 2> /dev/null + +[[ $(git diff charts/*/README.md) ]] && (echo "==> ERROR: documentation updated" && exit 1) + +exit 0 \ No newline at end of file diff --git a/githooks/pre-commit/20-lint b/githooks/pre-commit/20-lint new file mode 100755 index 0000000..cca45bf --- /dev/null +++ b/githooks/pre-commit/20-lint @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "==> Running helm template..." +ct lint --config ct.yaml \ No newline at end of file diff --git a/githooks/pre-commit/30-template b/githooks/pre-commit/30-template new file mode 100755 index 0000000..0be8f35 --- /dev/null +++ b/githooks/pre-commit/30-template @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +echo "==> Running helm template..." +for chart in charts/* +do + helm template $chart > /dev/null +done