Skip to content

Commit

Permalink
Improved template linting/validation + CI integration
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Aug 14, 2018
1 parent d5a68a3 commit aa00612
Show file tree
Hide file tree
Showing 12 changed files with 399 additions and 263 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
### Zero to JupyterHub Kubernetes ###
tools/lint-output/
tools/templates/rendered-templates/
bin/
ci/.vagrant

.vscode

### macOS ###
*.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script:
- chartpress --commit-range ${TRAVIS_COMMIT_RANGE}
- git diff
- ./ci/test.sh
- python3 tools/templates/lint-and-validate.py

deploy:
provider: script
Expand All @@ -21,7 +22,6 @@ deploy:
on:
branch:
- master
- v0.7-dev
condition: "$KUBE_VERSION = 1.9.4"
env:
matrix:
Expand Down
9 changes: 9 additions & 0 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v${MINIKUBE_V
chmod +x minikube
mv minikube bin/

echo "installing kubeval"
if ! [ -f bin/kubeval-${KUBEVAL_VERSION} ]; then
curl -sSLo bin/kubeval-${KUBEVAL_VERSION}.tar.gz https://github.com/garethr/kubeval/releases/download/${KUBEVAL_VERSION}/kubeval-linux-amd64.tar.gz
tar --extract --file bin/kubeval-${KUBEVAL_VERSION}.tar.gz --directory bin
rm bin/kubeval-${KUBEVAL_VERSION}.tar.gz
mv bin/kubeval bin/kubeval-${KUBEVAL_VERSION}
fi
cp bin/kubeval-${KUBEVAL_VERSION} bin/kubeval

echo "starting minikube with RBAC"
sudo CHANGE_MINIKUBE_NONE_USER=true $PWD/bin/minikube start --vm-driver=none --kubernetes-version=v${KUBE_VERSION} --extra-config=apiserver.Authorization.Mode=RBAC --bootstrapper=localkube
minikube update-context
Expand Down
1 change: 1 addition & 0 deletions ci/minikube.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export MINIKUBE_VERSION=0.28.0
export HELM_VERSION=2.9.1
export KUBEVAL_VERSION=0.7.1
export PATH="$PWD/bin:$PATH"
13 changes: 12 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# chartpress is important for local development, CI and CD
# - builds images and can push them also (--push)
# - updates image names and tags in values.yaml
# - can publish the built Helm chart (--publish)
chartpress==0.2.1

# yamllint is important for local development, CI
# - used within tools/templates/lint-and-validate.py
yamllint>=1.1.1

# PyGithub and python-dateutil is rarely used
# - used within tools/contributors.py
PyGithub>=1
python-dateutil>=2
chartpress==0.2.1
6 changes: 3 additions & 3 deletions jupyterhub/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: jupyterhub
version: v0.7-dev
appVersion: v0.8.1
appVersion: v0.9.2
description: Multi-user Jupyter installation
home: https://z2jh.jupyter.org
sources:
- https://github.com/jupyterhub/zero-to-jupyterhub-k8s
icon: https://jupyter.org/assets/hublogo.svg
kubeVersion: ">=1.8.0-0"
tillerVersion: ">=2.7.0-0"
kubeVersion: '>=1.8.0-0'
tillerVersion: '>=2.7.0-0'
13 changes: 7 additions & 6 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hub:
# sqlite-pvc backed hub requires Recreate strategy to work
type: Recreate
# This is required for upgrading to work
rollingUpdate: null
rollingUpdate:
db:
type: sqlite-pvc
upgrade:
Expand All @@ -31,7 +31,7 @@ hub:
url:
labels: {}
annotations:
prometheus.io/scrape: "true"
prometheus.io/scrape: 'true'
prometheus.io/path: /hub/metrics
extraConfig: {}
extraConfigMap: {}
Expand Down Expand Up @@ -92,8 +92,9 @@ proxy:
image:
name: jetstack/kube-lego
tag: 0.1.6
pullPolicy: IfNotPresent
resources: {}
labels:
labels: {}
nodeSelector: {}
pdb:
enabled: true
Expand All @@ -107,9 +108,9 @@ proxy:
key:
cert:
secret:
name: ""
key: ""
crt: ""
name: ''
key: ''
crt: ''
hosts: []
networkPolicy:
enabled: false
Expand Down
192 changes: 0 additions & 192 deletions tools/lint-chart-values.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions tools/lint.py

This file was deleted.

Loading

0 comments on commit aa00612

Please sign in to comment.