From c236a3a48a573626dc20e86da3a07a23559f1481 Mon Sep 17 00:00:00 2001 From: Yuvraj <10830562+evalsocket@users.noreply.github.com> Date: Tue, 11 Aug 2020 22:02:51 +0530 Subject: [PATCH] Added e2e test in release (#1042) * e2e test added in release * added steps * dirty added in hash * new make command added * dirty remove from make --- .github/workflows/build.yaml | 7 ++++- .github/workflows/release.yaml | 57 +++++++++++++++------------------- Makefile | 8 +++-- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 160055b0c9..5d36158750 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,9 +23,14 @@ jobs: with: go-version: 1.14 - - name : binary build & kustomize + - name : docker images build + run: | + make docker-build-all + + - name : Create Kind Cluster and setup kustomize run: | make ci + - name: e2e testing run: | echo ">>> Install Kyverno" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6ae87b4458..b1916a1824 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,31 @@ jobs: with: go-version: 1.14 - uses: creekorful/goreportcard-action@v1.0 + + - name: login to docker hub + run: echo "${{ secrets.DOCKERIO_PASSWORD }}" | docker login -u "${{ secrets.DOCKERIO_USERNAME }}" --password-stdin + + - name : docker images publish + run: | + make docker-publish-all + + - name : Create Kind Cluster and setup kustomize + run: | + make ci + + - name: e2e testing + run: | + echo ">>> Install Kyverno" + sed 's/imagePullPolicy:.*$/imagePullPolicy: IfNotPresent/g' ${GITHUB_WORKSPACE}/definitions/install.yaml | kubectl apply -f - + kubectl apply -f ${GITHUB_WORKSPACE}/definitions/github/rbac.yaml + chmod a+x ${GITHUB_WORKSPACE}/scripts/verify-deployment.sh + sleep 50 + echo ">>> Check kyverno" + kubectl get pods -n kyverno + ${GITHUB_WORKSPACE}/scripts/verify-deployment.sh -n kyverno kyverno + echo ">>> Run Kyverno e2e test" + make test-e2e + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 @@ -29,38 +54,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - name : binary build & kustomize - run: | - make kyverno - make initContainer - - - name: Get latest release version number - id: get_version - uses: battila7/get-version-action@v2 - - - - uses: docker/build-push-action@v1 - name: kyverno docker build and publish - with: - username: ${{ secrets.DOCKERIO_USERNAME }} - password: ${{ secrets.DOCKERIO_PASSWORD }} - repository: "nirmata/kyverno" - push: true - path: cmd/kyverno/ - dockerfile: cmd/kyverno/Dockerfile - tags: ${{ steps.get_version.outputs.version }} - - - - uses: docker/build-push-action@v1 - name: kyvernopre docker build and publish - with: - username: ${{ secrets.DOCKERIO_USERNAME }} - password: ${{ secrets.DOCKERIO_PASSWORD }} - repository: "nirmata/kyvernopre" - push: true - path: cmd/initContainer/ - dockerfile: cmd/initContainer/Dockerfile - tags: ${{ steps.get_version.outputs.version }} - uses: J12934/helm-gh-pages-action@master name: Run Helm Publish diff --git a/Makefile b/Makefile index 2cd6ae6bea..e55bc7a454 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ ################################## # DEFAULTS ################################## -GIT_VERSION := $(shell git describe --dirty --always --tags) +GIT_VERSION := $(shell git describe --always --tags) GIT_BRANCH := $(shell git branch | grep \* | cut -d ' ' -f2) GIT_HASH := $(GIT_BRANCH)/$(shell git log -1 --pretty=format:"%H") TIMESTAMP := $(shell date '+%Y-%m-%d_%I:%M:%S%p') @@ -93,7 +93,11 @@ cli: ################################## -ci: docker-build-kyverno docker-build-initContainer +docker-publish-all: docker-publish-initContainer docker-publish-kyverno + +docker-build-all: docker-build-initContainer docker-build-kyverno + +ci: echo "kustomize input" chmod a+x $(PWD)/scripts/ci.sh $(PWD)/scripts/ci.sh