From 182156d9b47730cb392fbeb563e5b72166a1a610 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 6 Aug 2019 22:13:19 +0300 Subject: [PATCH 1/3] Add build step to e2e tests --- .circleci/config.yml | 24 ++++++++++++++++-------- e2e/build.sh | 6 ++++++ e2e/install.sh | 3 --- 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100755 e2e/build.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index e7531f5..2094ea9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,11 +4,20 @@ jobs: machine: true steps: - checkout - - run: e2e/bootstrap.sh - - run: e2e/install.sh - - run: e2e/test.sh + - run: + name: Build podinfo container + command: e2e/build.sh + - run: + name: Start Kubernetes Kind cluster + command: e2e/bootstrap.sh + - run: + name: Install podinfo with Helm + command: e2e/install.sh + - run: + name: Run Helm tests + command: e2e/test.sh - build-container: + push-container: docker: - image: circleci/golang:1.12 working_directory: ~/build @@ -78,17 +87,16 @@ workflows: version: 2 build-test: jobs: - - build-container - e2e-kubernetes release: jobs: - - build-container: + - push-binary: filters: branches: ignore: /.*/ tags: ignore: /^chart.*/ - - push-binary: + - push-container: filters: branches: ignore: /.*/ @@ -96,7 +104,7 @@ workflows: ignore: /^chart.*/ - push-helm-charts: requires: - - build-container + - push-container filters: branches: ignore: /.*/ diff --git a/e2e/build.sh b/e2e/build.sh new file mode 100755 index 0000000..9b6523c --- /dev/null +++ b/e2e/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -o errexit + +docker build -t test/podinfo:latest . + diff --git a/e2e/install.sh b/e2e/install.sh index 3d2f9ac..2b0775c 100755 --- a/e2e/install.sh +++ b/e2e/install.sh @@ -5,9 +5,6 @@ set -o errexit REPO_ROOT=$(git rev-parse --show-toplevel) export KUBECONFIG="$(kind get kubeconfig-path --name="kind")" -echo ">>> Building container" -docker build -t test/podinfo:latest . - echo '>>> Loading image in Kind' kind load docker-image test/podinfo:latest From d34da2ab9194e9c5346adad65f252f4d1d1fdae6 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 6 Aug 2019 22:15:19 +0300 Subject: [PATCH 2/3] Release v2.0.2 --- charts/podinfo/Chart.yaml | 4 ++-- charts/podinfo/values.yaml | 2 +- kustomize/deployment.yaml | 2 +- pkg/version/version.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/podinfo/Chart.yaml b/charts/podinfo/Chart.yaml index 032a897..02f58df 100644 --- a/charts/podinfo/Chart.yaml +++ b/charts/podinfo/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -version: 2.0.1 -appVersion: 2.0.1 +version: 2.0.2 +appVersion: 2.0.2 name: podinfo engine: gotpl description: Podinfo Helm chart for Kubernetes diff --git a/charts/podinfo/values.yaml b/charts/podinfo/values.yaml index 71063ea..3435593 100644 --- a/charts/podinfo/values.yaml +++ b/charts/podinfo/values.yaml @@ -12,7 +12,7 @@ faults: image: repository: quay.io/stefanprodan/podinfo - tag: 2.0.1 + tag: 2.0.2 pullPolicy: IfNotPresent service: diff --git a/kustomize/deployment.yaml b/kustomize/deployment.yaml index e80590e..580c1a6 100644 --- a/kustomize/deployment.yaml +++ b/kustomize/deployment.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: podinfod - image: quay.io/stefanprodan/podinfo:2.0.1 + image: quay.io/stefanprodan/podinfo:2.0.2 imagePullPolicy: IfNotPresent ports: - containerPort: 9898 diff --git a/pkg/version/version.go b/pkg/version/version.go index 49b9a00..3ff7884 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,4 +1,4 @@ package version -var VERSION = "2.0.1" +var VERSION = "2.0.2" var REVISION = "unknown" From 75649496952475aa644cd90880296fcf24420998 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 6 Aug 2019 22:53:20 +0300 Subject: [PATCH 3/3] Add e2e docs --- e2e/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 e2e/README.md diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 0000000..8017582 --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,35 @@ +# podinfo end-to-end testing + +The e2e testing infrastructure is powered by CircleCI and [Kubernetes Kind](https://github.com/kubernetes-sigs/kind). + +### CI workflow + +* download go modules +* run unit tests +* build container +* install kubectl, helm and Kubernetes Kind CLIs +* create local Kubernetes cluster with kind +* deploy Tiller on the local cluster +* load podinfo image onto the local cluster +* deploy podinfo with Helm +* run Helm tests + +```yaml +jobs: + e2e-kubernetes: + machine: true + steps: + - checkout + - run: + name: Build podinfo container + command: e2e/build.sh + - run: + name: Start Kubernetes Kind cluster + command: e2e/bootstrap.sh + - run: + name: Install podinfo with Helm + command: e2e/install.sh + - run: + name: Run Helm tests + command: e2e/test.sh +```