commit
4784e8b60d
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -3,19 +3,19 @@
|
|||
These resources work as is. To optionally confirm this,
|
||||
apply it to your cluster.
|
||||
|
||||
<!-- @runKinflate @demo -->
|
||||
<!-- @runKinflate -->
|
||||
```
|
||||
kubectl apply -f $TUT_APP
|
||||
```
|
||||
|
||||
<!-- @showResources @demo -->
|
||||
<!-- @showResources -->
|
||||
```
|
||||
kubectl get deployments
|
||||
```
|
||||
|
||||
Define some functions to query the server directly:
|
||||
|
||||
<!-- @funcGetAddress @env @test -->
|
||||
<!-- @funcGetAddress -->
|
||||
```
|
||||
function tut_getServiceAddress {
|
||||
local name=$1
|
||||
|
|
@ -33,14 +33,14 @@ function tut_query {
|
|||
|
||||
Query it:
|
||||
|
||||
<!-- @query @demo -->
|
||||
<!-- @query -->
|
||||
```
|
||||
tut_query tut-service peach
|
||||
```
|
||||
|
||||
All done. Clear the cluster for the next example.
|
||||
|
||||
<!-- @query @demo -->
|
||||
<!-- @query -->
|
||||
```
|
||||
kubectl delete deployment tut-deployment
|
||||
kubectl delete service tut-service
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Compare to see result:
|
|||
|
||||
<!-- @checkDiffs @test -->
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
<!-- @checkDiffsAgain @test -->
|
||||
<!-- @checkDiffsAgain -->
|
||||
```
|
||||
diff $TUT_TMP/original_out $TUT_TMP/customized_out | more
|
||||
```
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ kinflate init
|
|||
<!-- @showIt @test -->
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
<!-- @showItAgain @test -->
|
||||
<!-- @confirmIt @test -->
|
||||
```
|
||||
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.
|
||||
|
||||
<!-- @addNoResource @test -->
|
||||
<!-- @addNoResource -->
|
||||
```
|
||||
kinflate add resource does_not_exist.yaml
|
||||
```
|
||||
|
||||
Try to reinit
|
||||
<!-- @initAgain @test -->
|
||||
Try to reinit; kinflate should complain.
|
||||
<!-- @initAgain -->
|
||||
```
|
||||
kinflate init
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
||||
<!-- @showOutput @test -->
|
||||
<!-- @showOutput -->
|
||||
```
|
||||
more $TUT_TMP/original_out
|
||||
```
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ structure:
|
|||
find $TUT_APP
|
||||
```
|
||||
|
||||
<!-- @compareKinflateOutput @test -->
|
||||
<!-- @compareKinflateOutput -->
|
||||
```
|
||||
diff \
|
||||
<(kinflate inflate -f $TUT_APP/staging) \
|
||||
|
|
@ -31,33 +31,33 @@ kinflate inflate -f $TUT_APP/production
|
|||
|
||||
Deploy them:
|
||||
|
||||
<!-- @deployStaging @test -->
|
||||
<!-- @deployStaging -->
|
||||
```
|
||||
kinflate inflate -f $TUT_APP/staging |\
|
||||
kubectl apply -f -
|
||||
```
|
||||
|
||||
<!-- @deployProduction @test -->
|
||||
<!-- @deployProduction -->
|
||||
```
|
||||
kinflate inflate -f $TUT_APP/production |\
|
||||
kubectl apply -f -
|
||||
```
|
||||
|
||||
<!-- @getAll @demo -->
|
||||
<!-- @getAll -->
|
||||
```
|
||||
kubectl get all
|
||||
```
|
||||
|
||||
Delete the resources:
|
||||
|
||||
<!-- @deleteStaging @demo -->
|
||||
<!-- @deleteStaging -->
|
||||
```
|
||||
kubectl delete configmap staging-acme-tut-map
|
||||
kubectl delete service staging-acme-tut-service
|
||||
kubectl delete deployment staging-acme-tut-deployment
|
||||
```
|
||||
|
||||
<!-- @deleteProduction @demo -->
|
||||
<!-- @deleteProduction -->
|
||||
```
|
||||
kinflate inflate -f $TUT_APP/production |\
|
||||
kubectl delete -f -
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ A manifest is always called
|
|||
|
||||
> `Kube-manifest.yaml`
|
||||
|
||||
<!-- @defineManifest @demo -->
|
||||
<!-- @defineManifest @test -->
|
||||
```
|
||||
export TUT_APP_MANIFEST=$TUT_APP/Kube-manifest.yaml
|
||||
```
|
||||
|
||||
<!-- @makeManifest @demo -->
|
||||
<!-- @makeManifest @test -->
|
||||
```
|
||||
cat <<'EOF' >$TUT_APP_MANIFEST
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue