From 4d6ecd8b5139b6471cd629188e6e2be3b8892a6e Mon Sep 17 00:00:00 2001 From: Richard Kovacs Date: Sat, 5 Nov 2022 09:48:35 +0100 Subject: [PATCH] Release pipeline --- .github/RELEASE_TEMPLATE.md | 57 +++++++++++++++++++++ .github/workflows/_kuttl.yml | 7 ++- .github/workflows/_test.yml | 21 ++++++++ .github/workflows/e2e-on-pr.yml | 6 ++- .github/workflows/release.yaml | 90 +++++++++++++++++++++++++++++++++ .gitignore | 4 ++ Makefile | 7 +++ 7 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 .github/RELEASE_TEMPLATE.md create mode 100644 .github/workflows/_test.yml create mode 100644 .github/workflows/release.yaml diff --git a/.github/RELEASE_TEMPLATE.md b/.github/RELEASE_TEMPLATE.md new file mode 100644 index 0000000..a326437 --- /dev/null +++ b/.github/RELEASE_TEMPLATE.md @@ -0,0 +1,57 @@ +# How to try it + +## Prerequisite + * Kubernetes cluster + * Kubeconfig to deploy + * Configured AWS EBS CSI driver + * Installed Cert Manager (`make deploy-cert-manager` should help) + +## How to try it +```console +cat <> $GITHUB_ENV + - name: "Generate release changelog" + uses: heinrichreimer/github-changelog-generator-action@v2.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: .github/RELEASE_TEMPLATE.md + sinceTag: ${{ env.SINCE_TAG }} + simpleList: true + - name: Fix version in changelog + run: sed -i "s/#VERSION#/${{ github.ref_name }}/g" CHANGELOG.md + - name: Create pre-release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + body_path: CHANGELOG.md + files: | + discoblocks-bundle.yaml + discoblocks-kustomize.tar.gz + needs: [image-vulnerability-scan, kuttl] diff --git a/.gitignore b/.gitignore index 87e67cc..6e3fbec 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,7 @@ kubeconfig *.swp *.swo *~ + +CHANGELOG.md +discoblocks-bundle.yaml +discoblocks-kustomize.tar.gz \ No newline at end of file diff --git a/Makefile b/Makefile index be5a98a..018ea5d 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,13 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: bundle +bundle: manifests kustomize ## Generates Kubernetes manifests + rm -rf discoblocks-bundle.yaml + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + $(KUSTOMIZE) build config/default > discoblocks-bundle.yaml + cd config/manager && $(KUSTOMIZE) edit set image controller=discoblocks:latest + .PHONY: deploy-cert-manager deploy-cert-manager: manifests kustomize ## Deploy cert manager to the K8s cluster specified in ~/.kube/config. kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml