diff --git a/.travis.yml b/.travis.yml index f81ad6279..17a6b47f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ before_install: - go get -u github.com/golang/lint/golint - go get -u golang.org/x/tools/cmd/goimports - go get -u github.com/onsi/ginkgo/ginkgo + - go get -u github.com/monopole/mdrip # Install must be set to prevent default `go get` to run. # The dependencies have already been vendored by `dep` so diff --git a/bin/pre-commit.sh b/bin/pre-commit.sh index 9824c3c4e..551c65954 100755 --- a/bin/pre-commit.sh +++ b/bin/pre-commit.sh @@ -30,4 +30,8 @@ echo "Running go test" go test -v ./... rc=$((rc || $?)) +echo "Testing kinflate demos" +mdrip --mode test --label test ./cmd/kinflate +rc=$((rc || $?)) + exit $rc diff --git a/cmd/kinflate/longerDemo/base.md b/cmd/kinflate/longerDemo/base.md index f2188f97f..12e6843dc 100644 --- a/cmd/kinflate/longerDemo/base.md +++ b/cmd/kinflate/longerDemo/base.md @@ -3,19 +3,19 @@ These resources work as is. To optionally confirm this, apply it to your cluster. - + ``` kubectl apply -f $TUT_APP ``` - + ``` kubectl get deployments ``` Define some functions to query the server directly: - + ``` function tut_getServiceAddress { local name=$1 @@ -33,14 +33,14 @@ function tut_query { Query it: - + ``` tut_query tut-service peach ``` All done. Clear the cluster for the next example. - + ``` kubectl delete deployment tut-deployment kubectl delete service tut-service diff --git a/cmd/kinflate/longerDemo/customization.md b/cmd/kinflate/longerDemo/customization.md index fdb5a46cd..2f6319ed1 100644 --- a/cmd/kinflate/longerDemo/customization.md +++ b/cmd/kinflate/longerDemo/customization.md @@ -31,7 +31,7 @@ Compare to see result: ``` -diff $TUT_TMP/original_out $TUT_TMP/customized_out +diff $TUT_TMP/original_out $TUT_TMP/customized_out || true ``` ## Labels and annotations @@ -54,7 +54,7 @@ EOF kinflate inflate -f $TUT_APP >$TUT_TMP/customized_out ``` - + ``` diff $TUT_TMP/original_out $TUT_TMP/customized_out | more ``` diff --git a/cmd/kinflate/longerDemo/editor.md b/cmd/kinflate/longerDemo/editor.md index 743e59253..7984dc485 100644 --- a/cmd/kinflate/longerDemo/editor.md +++ b/cmd/kinflate/longerDemo/editor.md @@ -26,7 +26,7 @@ kinflate init ``` clear -more Kube-manifest.yaml +cat Kube-manifest.yaml ``` Write a resource file: @@ -56,20 +56,20 @@ Add it to the manifest: kinflate add resource configMap.yaml ``` - + ``` -more Kube-manifest.yaml +grep configMap.yaml Kube-manifest.yaml ``` -Add one that isn't there: +Attempt to add a missing resource; kinflate should complain. - + ``` kinflate add resource does_not_exist.yaml ``` -Try to reinit - +Try to reinit; kinflate should complain. + ``` kinflate init ``` diff --git a/cmd/kinflate/longerDemo/identity.md b/cmd/kinflate/longerDemo/identity.md index 3935082e9..e25067f1d 100644 --- a/cmd/kinflate/longerDemo/identity.md +++ b/cmd/kinflate/longerDemo/identity.md @@ -12,7 +12,7 @@ kinflate expects to find `Kube-manifest.yaml` in `$TUT_APP`. The above command discovers the resources, processes them, and emits the result to `stdout`. - + ``` more $TUT_TMP/original_out ``` diff --git a/cmd/kinflate/longerDemo/instances/compare.md b/cmd/kinflate/longerDemo/instances/compare.md index 6e2e51318..35cd1ce04 100644 --- a/cmd/kinflate/longerDemo/instances/compare.md +++ b/cmd/kinflate/longerDemo/instances/compare.md @@ -9,7 +9,7 @@ structure: find $TUT_APP ``` - + ``` diff \ <(kinflate inflate -f $TUT_APP/staging) \ @@ -31,33 +31,33 @@ kinflate inflate -f $TUT_APP/production Deploy them: - + ``` kinflate inflate -f $TUT_APP/staging |\ kubectl apply -f - ``` - + ``` kinflate inflate -f $TUT_APP/production |\ kubectl apply -f - ``` - + ``` kubectl get all ``` Delete the resources: - + ``` kubectl delete configmap staging-acme-tut-map kubectl delete service staging-acme-tut-service kubectl delete deployment staging-acme-tut-deployment ``` - + ``` kinflate inflate -f $TUT_APP/production |\ kubectl delete -f - diff --git a/cmd/kinflate/longerDemo/manifest.md b/cmd/kinflate/longerDemo/manifest.md index 9901b0479..493f240a8 100644 --- a/cmd/kinflate/longerDemo/manifest.md +++ b/cmd/kinflate/longerDemo/manifest.md @@ -7,12 +7,12 @@ A manifest is always called > `Kube-manifest.yaml` - + ``` export TUT_APP_MANIFEST=$TUT_APP/Kube-manifest.yaml ``` - + ``` cat <<'EOF' >$TUT_APP_MANIFEST