Test examples against HEAD as well as against latest release.

This commit is contained in:
Jeffrey Regan
2019-08-20 13:51:45 -07:00
parent 2b6a406dc7
commit 423a8a6e0d
26 changed files with 244 additions and 223 deletions

View File

@@ -20,13 +20,13 @@ that is just a single pod.
Define a place to work:
<!-- @makeWorkplace @test -->
<!-- @makeWorkplace @testAgainstLatestRelease -->
```
DEMO_HOME=$(mktemp -d)
```
Define a common base:
<!-- @makeBase @test -->
<!-- @makeBase @testAgainstLatestRelease -->
```
BASE=$DEMO_HOME/base
mkdir $BASE
@@ -51,7 +51,7 @@ EOF
```
Define a dev variant overlaying base:
<!-- @makeDev @test -->
<!-- @makeDev @testAgainstLatestRelease -->
```
DEV=$DEMO_HOME/dev
mkdir $DEV
@@ -64,7 +64,7 @@ EOF
```
Define a staging variant overlaying base:
<!-- @makeStaging @test -->
<!-- @makeStaging @testAgainstLatestRelease -->
```
STAG=$DEMO_HOME/staging
mkdir $STAG
@@ -77,7 +77,7 @@ EOF
```
Define a production variant overlaying base:
<!-- @makeProd @test -->
<!-- @makeProd @testAgainstLatestRelease -->
```
PROD=$DEMO_HOME/production
mkdir $PROD
@@ -90,7 +90,7 @@ EOF
```
Then define a _Kustomization_ composing three variants together:
<!-- @makeTopLayer @test -->
<!-- @makeTopLayer @testAgainstLatestRelease -->
```
cat <<EOF >$DEMO_HOME/kustomization.yaml
resources:
@@ -119,7 +119,7 @@ Now the workspace has following directories
Confirm that the `kustomize build` output contains three pod objects from dev, staging and production variants.
<!-- @confirmVariants @test -->
<!-- @confirmVariants @testAgainstLatestRelease -->
```
test 1 == \
$(kustomize build $DEMO_HOME | grep cluster-a-dev-myapp-pod | wc -l); \

View File

@@ -8,13 +8,13 @@ following demonstrates this using a base that's just one pod.
Define a place to work:
<!-- @makeWorkplace @test -->
<!-- @makeWorkplace @testAgainstLatestRelease -->
```
DEMO_HOME=$(mktemp -d)
```
Define a common base:
<!-- @makeBase @test -->
<!-- @makeBase @testAgainstLatestRelease -->
```
BASE=$DEMO_HOME/base
mkdir $BASE
@@ -39,7 +39,7 @@ EOF
```
Define a variant in namespace-a overlaying base:
<!-- @makeNamespaceA @test -->
<!-- @makeNamespaceA @testAgainstLatestRelease -->
```
NSA=$DEMO_HOME/namespace-a
mkdir $NSA
@@ -60,7 +60,7 @@ EOF
```
Define a variant in namespace-b overlaying base:
<!-- @makeNamespaceB @test -->
<!-- @makeNamespaceB @testAgainstLatestRelease -->
```
NSB=$DEMO_HOME/namespace-b
mkdir $NSB
@@ -81,7 +81,7 @@ EOF
```
Then define a _Kustomization_ composing two variants together:
<!-- @makeTopLayer @test -->
<!-- @makeTopLayer @testAgainstLatestRelease -->
```
cat <<EOF >$DEMO_HOME/kustomization.yaml
resources:
@@ -107,7 +107,7 @@ Now the workspace has following directories
Confirm that the `kustomize build` output contains two pod objects from namespace-a and namespace-b.
<!-- @confirmVariants @test -->
<!-- @confirmVariants @testAgainstLatestRelease -->
```
test 2 == \
$(kustomize build $DEMO_HOME| grep -B 4 "namespace: namespace-[ab]" | grep "name: myapp-pod" | wc -l); \