From 9bc92f133fd3e0753f2904d11319198e9606c2c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Tue, 15 May 2018 15:43:02 -0700 Subject: [PATCH] demoReorgToEaseTesting --- demos/README.md | 8 ++--- demos/{helloWorld.md => helloWorld/README.md} | 2 +- demos/{data => }/helloWorld/configMap.yaml | 0 demos/{data => }/helloWorld/deployment.yaml | 0 .../{data => }/helloWorld/kustomization.yaml | 0 demos/{data => }/helloWorld/service.yaml | 0 test/main.sh => demos/integration_tests.sh | 35 ++++++++++++------- demos/{ldap.md => ldap/README.md} | 2 +- demos/{data => }/ldap/base/deployment.yaml | 0 demos/{data => }/ldap/base/env.startup.txt | 0 demos/{data => }/ldap/base/kustomization.yaml | 0 demos/{data => }/ldap/base/service.yaml | 0 .../test.sh => ldap/integration_test.sh} | 0 .../ldap/overlays/production/deployment.yaml | 0 .../overlays/production/kustomization.yaml | 0 .../ldap/overlays/staging/config.env | 0 .../ldap/overlays/staging/deployment.yaml | 0 .../ldap/overlays/staging/kustomization.yaml | 0 demos/{mySql.md => mySql/README.md} | 2 +- demos/{data => }/mySql/deployment.yaml | 0 demos/{data => }/mySql/secret.yaml | 0 demos/{data => }/mySql/service.yaml | 0 demos/{springboot.md => springboot/README.md} | 2 +- .../springboot/base/deployment.yaml | 0 demos/{data => }/springboot/base/service.yaml | 0 .../production/application.properties | 0 .../production/healthcheck_patch.yaml | 0 .../overlays/production/kustomization.yaml | 0 .../production/memorylimit_patch.yaml | 0 .../springboot/overlays/production/patch.yaml | 0 .../overlays/staging/application.properties | 0 .../overlays/staging/kustomization.yaml | 0 .../springboot/overlays/staging/staging.env | 0 33 files changed, 31 insertions(+), 20 deletions(-) rename demos/{helloWorld.md => helloWorld/README.md} (99%) rename demos/{data => }/helloWorld/configMap.yaml (100%) rename demos/{data => }/helloWorld/deployment.yaml (100%) rename demos/{data => }/helloWorld/kustomization.yaml (100%) rename demos/{data => }/helloWorld/service.yaml (100%) rename test/main.sh => demos/integration_tests.sh (53%) rename demos/{ldap.md => ldap/README.md} (99%) rename demos/{data => }/ldap/base/deployment.yaml (100%) rename demos/{data => }/ldap/base/env.startup.txt (100%) rename demos/{data => }/ldap/base/kustomization.yaml (100%) rename demos/{data => }/ldap/base/service.yaml (100%) rename demos/{data/ldap/base/tests/test.sh => ldap/integration_test.sh} (100%) rename demos/{data => }/ldap/overlays/production/deployment.yaml (100%) rename demos/{data => }/ldap/overlays/production/kustomization.yaml (100%) rename demos/{data => }/ldap/overlays/staging/config.env (100%) rename demos/{data => }/ldap/overlays/staging/deployment.yaml (100%) rename demos/{data => }/ldap/overlays/staging/kustomization.yaml (100%) rename demos/{mySql.md => mySql/README.md} (99%) rename demos/{data => }/mySql/deployment.yaml (100%) rename demos/{data => }/mySql/secret.yaml (100%) rename demos/{data => }/mySql/service.yaml (100%) rename demos/{springboot.md => springboot/README.md} (99%) rename demos/{data => }/springboot/base/deployment.yaml (100%) rename demos/{data => }/springboot/base/service.yaml (100%) rename demos/{data => }/springboot/overlays/production/application.properties (100%) rename demos/{data => }/springboot/overlays/production/healthcheck_patch.yaml (100%) rename demos/{data => }/springboot/overlays/production/kustomization.yaml (100%) rename demos/{data => }/springboot/overlays/production/memorylimit_patch.yaml (100%) rename demos/{data => }/springboot/overlays/production/patch.yaml (100%) rename demos/{data => }/springboot/overlays/staging/application.properties (100%) rename demos/{data => }/springboot/overlays/staging/kustomization.yaml (100%) rename demos/{data => }/springboot/overlays/staging/staging.env (100%) diff --git a/demos/README.md b/demos/README.md index aef195f517..a4c9fff67d 100644 --- a/demos/README.md +++ b/demos/README.md @@ -3,17 +3,17 @@ These demos assume that `kustomize` is on your `$PATH`. They are covered by pre-submit tests. - * [hello world](helloWorld.md) - Deploy multiple + * [hello world](helloWorld/README.md) - Deploy multiple (differently configured) variants of a simple Hello World server. - * [LDAP](ldap.md) - Deploy multiple + * [LDAP](ldap/README.md) - Deploy multiple (differently configured) variants of a LDAP server. - * [mySql](mySql.md) - Create a MySQL production + * [mySql](mySql/README.md) - Create a MySQL production configuration from scratch. - * [springboot](springboot.md) - Create a Spring Boot + * [springboot](springboot/README.md) - Create a Spring Boot application production configuration from scratch. * [configGeneration](configGeneration.md) - diff --git a/demos/helloWorld.md b/demos/helloWorld/README.md similarity index 99% rename from demos/helloWorld.md rename to demos/helloWorld/README.md index d85e77f2c6..e739984a47 100644 --- a/demos/helloWorld.md +++ b/demos/helloWorld/README.md @@ -50,7 +50,7 @@ mkdir -p $BASE curl -s -o "$BASE/#1.yaml" "https://raw.githubusercontent.com\ /kubernetes-sigs/kustomize\ -/master/demos/data/helloWorld\ +/master/demos/helloWorld\ /{configMap,deployment,kustomization,service}.yaml" ``` diff --git a/demos/data/helloWorld/configMap.yaml b/demos/helloWorld/configMap.yaml similarity index 100% rename from demos/data/helloWorld/configMap.yaml rename to demos/helloWorld/configMap.yaml diff --git a/demos/data/helloWorld/deployment.yaml b/demos/helloWorld/deployment.yaml similarity index 100% rename from demos/data/helloWorld/deployment.yaml rename to demos/helloWorld/deployment.yaml diff --git a/demos/data/helloWorld/kustomization.yaml b/demos/helloWorld/kustomization.yaml similarity index 100% rename from demos/data/helloWorld/kustomization.yaml rename to demos/helloWorld/kustomization.yaml diff --git a/demos/data/helloWorld/service.yaml b/demos/helloWorld/service.yaml similarity index 100% rename from demos/data/helloWorld/service.yaml rename to demos/helloWorld/service.yaml diff --git a/test/main.sh b/demos/integration_tests.sh similarity index 53% rename from test/main.sh rename to demos/integration_tests.sh index f93bef9781..08eab78955 100755 --- a/test/main.sh +++ b/demos/integration_tests.sh @@ -14,6 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. + +# This script run periodically by kubernetes test-infra. +# At time of writing, it's 'call point' was in +# https://github.com/kubernetes/test-infra/blob/master/jobs/config.json + function exit_with { local msg=$1 echo >&2 ${msg} @@ -22,25 +27,31 @@ function exit_with { base_dir="$( cd "$(dirname "$0")/../../.." && pwd )" cd "$base_dir" || { - echo "Cannot cd to '$base_dir'. Aborting." >&2 - exit 1 + exit_with "Cannot cd to ${base_dir}. Aborting." } -# Install kustomize to $GOPATH/bin and export PATH -go install ./cmd/kustomize || { exit_with "Failed to install kustomize"; } +go install github.com/kubernetes-sigs/kustomize || \ + { exit_with "Failed to install kustomize"; } export PATH=$GOPATH/bin:$PATH home=`pwd` -example_dir="./cmd/kustomize/demos/data/ldap/base" -if [ ! -d ${example_dir} ]; then - exit_with "directory ${example_dir} doesn't exist" + +### LDAP TEST ### +demo_dir="./demos/ldap" +if [ ! -d ${demo_dir} ]; then + exit_with "directory ${demo_dir} doesn't exist" fi -if [ -x "${example_dir}/tests/test.sh" ]; then - ${example_dir}/tests/test.sh ${example_dir} +test_script="${demo_dir}/integration_test.sh" + +if [ -x "${test_script}" ]; then + ${test_script} ${demo_dir}/base if [ $? -eq 0 ]; then - echo "testing ${example_dir} passed." + echo "testing ${demo_dir} passed." else - exit_with "testing ${example_dir} failed." + exit_with "testing ${demo_dir} failed." fi -fi \ No newline at end of file +else + exit_with "Unable to run ${test_script}" +fi +################# diff --git a/demos/ldap.md b/demos/ldap/README.md similarity index 99% rename from demos/ldap.md rename to demos/ldap/README.md index a79a7de175..85cb5efed7 100644 --- a/demos/ldap.md +++ b/demos/ldap/README.md @@ -45,7 +45,7 @@ mkdir -p $BASE CONTENT="https://raw.githubusercontent.com\ /kubernetes-sigs/kustomize\ -/master/demos/data/ldap" +/master/demos/ldap" curl -s -o "$BASE/#1" "$CONTENT/base\ /{deployment.yaml,kustomization.yaml,service.yaml,env.startup.txt}" diff --git a/demos/data/ldap/base/deployment.yaml b/demos/ldap/base/deployment.yaml similarity index 100% rename from demos/data/ldap/base/deployment.yaml rename to demos/ldap/base/deployment.yaml diff --git a/demos/data/ldap/base/env.startup.txt b/demos/ldap/base/env.startup.txt similarity index 100% rename from demos/data/ldap/base/env.startup.txt rename to demos/ldap/base/env.startup.txt diff --git a/demos/data/ldap/base/kustomization.yaml b/demos/ldap/base/kustomization.yaml similarity index 100% rename from demos/data/ldap/base/kustomization.yaml rename to demos/ldap/base/kustomization.yaml diff --git a/demos/data/ldap/base/service.yaml b/demos/ldap/base/service.yaml similarity index 100% rename from demos/data/ldap/base/service.yaml rename to demos/ldap/base/service.yaml diff --git a/demos/data/ldap/base/tests/test.sh b/demos/ldap/integration_test.sh similarity index 100% rename from demos/data/ldap/base/tests/test.sh rename to demos/ldap/integration_test.sh diff --git a/demos/data/ldap/overlays/production/deployment.yaml b/demos/ldap/overlays/production/deployment.yaml similarity index 100% rename from demos/data/ldap/overlays/production/deployment.yaml rename to demos/ldap/overlays/production/deployment.yaml diff --git a/demos/data/ldap/overlays/production/kustomization.yaml b/demos/ldap/overlays/production/kustomization.yaml similarity index 100% rename from demos/data/ldap/overlays/production/kustomization.yaml rename to demos/ldap/overlays/production/kustomization.yaml diff --git a/demos/data/ldap/overlays/staging/config.env b/demos/ldap/overlays/staging/config.env similarity index 100% rename from demos/data/ldap/overlays/staging/config.env rename to demos/ldap/overlays/staging/config.env diff --git a/demos/data/ldap/overlays/staging/deployment.yaml b/demos/ldap/overlays/staging/deployment.yaml similarity index 100% rename from demos/data/ldap/overlays/staging/deployment.yaml rename to demos/ldap/overlays/staging/deployment.yaml diff --git a/demos/data/ldap/overlays/staging/kustomization.yaml b/demos/ldap/overlays/staging/kustomization.yaml similarity index 100% rename from demos/data/ldap/overlays/staging/kustomization.yaml rename to demos/ldap/overlays/staging/kustomization.yaml diff --git a/demos/mySql.md b/demos/mySql/README.md similarity index 99% rename from demos/mySql.md rename to demos/mySql/README.md index 2dcbb21eb5..d9078a55fc 100644 --- a/demos/mySql.md +++ b/demos/mySql/README.md @@ -29,7 +29,7 @@ Download them: ``` curl -s -o "$DEMO_HOME/#1.yaml" "https://raw.githubusercontent.com\ /kubernetes-sigs/kustomize\ -/master/demos/data/mySql\ +/master/demos/mySql\ /{deployment,secret,service}.yaml" ``` diff --git a/demos/data/mySql/deployment.yaml b/demos/mySql/deployment.yaml similarity index 100% rename from demos/data/mySql/deployment.yaml rename to demos/mySql/deployment.yaml diff --git a/demos/data/mySql/secret.yaml b/demos/mySql/secret.yaml similarity index 100% rename from demos/data/mySql/secret.yaml rename to demos/mySql/secret.yaml diff --git a/demos/data/mySql/service.yaml b/demos/mySql/service.yaml similarity index 100% rename from demos/data/mySql/service.yaml rename to demos/mySql/service.yaml diff --git a/demos/springboot.md b/demos/springboot/README.md similarity index 99% rename from demos/springboot.md rename to demos/springboot/README.md index e35bcd1b5d..b91b5ead78 100644 --- a/demos/springboot.md +++ b/demos/springboot/README.md @@ -31,7 +31,7 @@ Download them: ``` CONTENT="https://raw.githubusercontent.com\ /kubernetes-sigs/kustomize\ -/master/demos/data/springboot" +/master/demos/springboot" curl -s -o "$DEMO_HOME/#1.yaml" \ "$CONTENT/base/{deployment,service}.yaml" diff --git a/demos/data/springboot/base/deployment.yaml b/demos/springboot/base/deployment.yaml similarity index 100% rename from demos/data/springboot/base/deployment.yaml rename to demos/springboot/base/deployment.yaml diff --git a/demos/data/springboot/base/service.yaml b/demos/springboot/base/service.yaml similarity index 100% rename from demos/data/springboot/base/service.yaml rename to demos/springboot/base/service.yaml diff --git a/demos/data/springboot/overlays/production/application.properties b/demos/springboot/overlays/production/application.properties similarity index 100% rename from demos/data/springboot/overlays/production/application.properties rename to demos/springboot/overlays/production/application.properties diff --git a/demos/data/springboot/overlays/production/healthcheck_patch.yaml b/demos/springboot/overlays/production/healthcheck_patch.yaml similarity index 100% rename from demos/data/springboot/overlays/production/healthcheck_patch.yaml rename to demos/springboot/overlays/production/healthcheck_patch.yaml diff --git a/demos/data/springboot/overlays/production/kustomization.yaml b/demos/springboot/overlays/production/kustomization.yaml similarity index 100% rename from demos/data/springboot/overlays/production/kustomization.yaml rename to demos/springboot/overlays/production/kustomization.yaml diff --git a/demos/data/springboot/overlays/production/memorylimit_patch.yaml b/demos/springboot/overlays/production/memorylimit_patch.yaml similarity index 100% rename from demos/data/springboot/overlays/production/memorylimit_patch.yaml rename to demos/springboot/overlays/production/memorylimit_patch.yaml diff --git a/demos/data/springboot/overlays/production/patch.yaml b/demos/springboot/overlays/production/patch.yaml similarity index 100% rename from demos/data/springboot/overlays/production/patch.yaml rename to demos/springboot/overlays/production/patch.yaml diff --git a/demos/data/springboot/overlays/staging/application.properties b/demos/springboot/overlays/staging/application.properties similarity index 100% rename from demos/data/springboot/overlays/staging/application.properties rename to demos/springboot/overlays/staging/application.properties diff --git a/demos/data/springboot/overlays/staging/kustomization.yaml b/demos/springboot/overlays/staging/kustomization.yaml similarity index 100% rename from demos/data/springboot/overlays/staging/kustomization.yaml rename to demos/springboot/overlays/staging/kustomization.yaml diff --git a/demos/data/springboot/overlays/staging/staging.env b/demos/springboot/overlays/staging/staging.env similarity index 100% rename from demos/data/springboot/overlays/staging/staging.env rename to demos/springboot/overlays/staging/staging.env