From cf26a9cefcebae790535885140ff079a7705cca4 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Wed, 27 May 2020 17:30:57 +0300 Subject: [PATCH] Remove CircleCI e2e tests --- .circleci/config.yml | 113 ------------------------------------------- e2e/README.md | 35 -------------- e2e/bootstrap.sh | 26 ---------- e2e/build.sh | 8 --- e2e/install.sh | 13 ----- e2e/test.sh | 12 ----- 6 files changed, 207 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 e2e/README.md delete mode 100755 e2e/bootstrap.sh delete mode 100755 e2e/build.sh delete mode 100755 e2e/install.sh delete mode 100755 e2e/test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b39d739..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,113 +0,0 @@ -version: 2.1 -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 v3 - command: e2e/install.sh - - run: - name: Run Helm tests - command: e2e/test.sh - - push-container: - docker: - - image: circleci/golang:1.14 - working_directory: ~/build - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: false - - run: make build-container - - run: | - if [ -z "$CIRCLE_TAG" ]; then - echo "Not a release, skipping container push"; - else - echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin; - echo $QUAY_PASS | docker login -u $QUAY_USER --password-stdin quay.io; - make push-container; - make push-base; - fi - - push-binary: - docker: - - image: circleci/golang:1.14 - steps: - - checkout - - run: curl -sL https://git.io/goreleaser | bash - - push-helm-charts: - docker: - - image: circleci/golang:1.14 - steps: - - checkout - - run: - name: Install kubectl - command: sudo curl -L https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && sudo chmod +x /usr/local/bin/kubectl - - run: - name: Install helm - command: sudo curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.14.2-linux-amd64.tar.gz | tar xz && sudo mv linux-amd64/helm /bin/helm && sudo rm -rf linux-amd64 - - run: - name: Initialize helm - command: helm init --client-only --kubeconfig=$HOME/.kube/kubeconfig - - run: - name: Lint charts - command: | - helm lint ./charts/* - - run: - name: Package charts - command: | - mkdir $HOME/charts - helm package ./charts/* --destination $HOME/charts - - run: - name: Publish charts - command: | - if echo "${CIRCLE_TAG}" | grep -Eq "[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then - REPOSITORY="https://stefanprodan:${GITHUB_TOKEN}@github.com/stefanprodan/podinfo.git" - git config user.email stefanprodan@users.noreply.github.com - git config user.name stefanprodan - git remote set-url origin ${REPOSITORY} - git checkout gh-pages - mv -f $HOME/charts/*.tgz . - helm repo index . --url https://stefanprodan.github.io/podinfo - git add . - git commit -m "Publish Helm charts v${CIRCLE_TAG}" - git push origin gh-pages - else - echo "Not a release! Skip charts publish" - fi - -workflows: - version: 2 - build-test: - jobs: - - e2e-kubernetes - release: - jobs: - - push-binary: - filters: - branches: - ignore: /.*/ - tags: - ignore: /^chart.*/ - - push-container: - filters: - branches: - ignore: /.*/ - tags: - ignore: /^chart.*/ - - push-helm-charts: - requires: - - push-container - filters: - branches: - ignore: /.*/ - tags: - ignore: /^chart.*/ \ No newline at end of file diff --git a/e2e/README.md b/e2e/README.md deleted file mode 100644 index 84ee1ba..0000000 --- a/e2e/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# 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 v3 and Kubernetes Kind CLIs -* create local Kubernetes cluster with kind -* load podinfo image onto the local cluster -* deploy podinfo with Helm -* set the podinfo image to the locally built one -* 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 -``` diff --git a/e2e/bootstrap.sh b/e2e/bootstrap.sh deleted file mode 100755 index 889cb1f..0000000 --- a/e2e/bootstrap.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -REPO_ROOT=$(git rev-parse --show-toplevel) -KIND_VERSION=v0.8.1 - -if [[ "$1" ]]; then - KIND_VERSION=$1 -fi - -echo ">>> Installing kubectl" -curl -sLO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ -chmod +x kubectl && \ -sudo mv kubectl /usr/local/bin/ - -echo ">>> Installing kind" -curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VERSION/kind-linux-amd64" -chmod +x kind -sudo mv kind /usr/local/bin/kind - -echo ">>> Creating kind cluster" -kind create cluster --wait 5m - -echo ">>> Installing Helm v3" -curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash diff --git a/e2e/build.sh b/e2e/build.sh deleted file mode 100755 index ed856e8..0000000 --- a/e2e/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -GIT_COMMIT=$(git rev-list -1 HEAD) - -docker build -t test/podinfo:latest --build-arg "REVISION=${GIT_COMMIT}" . - diff --git a/e2e/install.sh b/e2e/install.sh deleted file mode 100755 index aa3355c..0000000 --- a/e2e/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -REPO_ROOT=$(git rev-parse --show-toplevel) - -echo '>>> Loading image in Kind' -kind load docker-image test/podinfo:latest - -echo '>>> Installing' -helm upgrade -i podinfo ${REPO_ROOT}/charts/podinfo --namespace=default -kubectl set image deployment/podinfo podinfo=test/podinfo:latest -kubectl rollout status deployment/podinfo diff --git a/e2e/test.sh b/e2e/test.sh deleted file mode 100755 index c7ca391..0000000 --- a/e2e/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -function finish { - echo '>>> Test logs' - kubectl logs -l app=podinfo || true -} -trap "finish" EXIT SIGINT - -echo '>>> Start integration tests' -helm test podinfo