From a7b1b04920c1df125e87189d2f83e2b13276ab29 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Wed, 9 Sep 2020 16:44:03 +0300 Subject: [PATCH] Add bootstrap reinstall e2e test --- .github/workflows/bootstrap.yaml | 18 +++++++++++++++++- cmd/gotk/bootstrap.go | 2 +- docs/cmd/gotk_bootstrap.md | 2 +- docs/cmd/gotk_bootstrap_github.md | 2 +- docs/cmd/gotk_bootstrap_gitlab.md | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 211b567f..0b41c1a4 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -29,7 +29,15 @@ jobs: run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Build run: sudo go build -o ./bin/gotk ./cmd/gotk - - name: gotk bootstrap github + - name: bootstrap init + run: | + ./bin/gotk bootstrap github \ + --owner=fluxcd-testing \ + --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ + --path=test-cluster + env: + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} + - name: bootstrap no-op run: | ./bin/gotk bootstrap github \ --owner=fluxcd-testing \ @@ -41,6 +49,14 @@ jobs: run: | ./bin/gotk suspend kustomization gitops-system ./bin/gotk uninstall --resources --crds -s + - name: bootstrap reinstall + run: | + ./bin/gotk bootstrap github \ + --owner=fluxcd-testing \ + --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ + --path=test-cluster + env: + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} - name: delete repository run: | ./bin/gotk bootstrap github \ diff --git a/cmd/gotk/bootstrap.go b/cmd/gotk/bootstrap.go index e90d4f3a..5802cf26 100644 --- a/cmd/gotk/bootstrap.go +++ b/cmd/gotk/bootstrap.go @@ -72,7 +72,7 @@ func init() { bootstrapCmd.PersistentFlags().StringVar(&bootstrapArch, "arch", "amd64", "arch can be amd64 or arm64") bootstrapCmd.PersistentFlags().StringVar(&bootstrapBranch, "branch", bootstrapDefaultBranch, - "default branch (for GitHub this must match the organization default branch setting)") + "default branch (for GitHub this must match the default branch setting for the organization)") rootCmd.AddCommand(bootstrapCmd) } diff --git a/docs/cmd/gotk_bootstrap.md b/docs/cmd/gotk_bootstrap.md index 9cd75b6d..de373453 100644 --- a/docs/cmd/gotk_bootstrap.md +++ b/docs/cmd/gotk_bootstrap.md @@ -10,7 +10,7 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git ``` --arch string arch can be amd64 or arm64 (default "amd64") - --branch string default branch (for GitHub this must match the organization default branch setting) (default "master") + --branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master") --components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller]) -h, --help help for bootstrap --image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry diff --git a/docs/cmd/gotk_bootstrap_github.md b/docs/cmd/gotk_bootstrap_github.md index 3ddc3a97..5bca06e9 100644 --- a/docs/cmd/gotk_bootstrap_github.md +++ b/docs/cmd/gotk_bootstrap_github.md @@ -58,7 +58,7 @@ gotk bootstrap github [flags] ``` --arch string arch can be amd64 or arm64 (default "amd64") - --branch string default branch (for GitHub this must match the organization default branch setting) (default "master") + --branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master") --components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller]) --image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry --kubeconfig string path to the kubeconfig file (default "~/.kube/config") diff --git a/docs/cmd/gotk_bootstrap_gitlab.md b/docs/cmd/gotk_bootstrap_gitlab.md index f666688e..7c7805ab 100644 --- a/docs/cmd/gotk_bootstrap_gitlab.md +++ b/docs/cmd/gotk_bootstrap_gitlab.md @@ -55,7 +55,7 @@ gotk bootstrap gitlab [flags] ``` --arch string arch can be amd64 or arm64 (default "amd64") - --branch string default branch (for GitHub this must match the organization default branch setting) (default "master") + --branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master") --components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller]) --image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry --kubeconfig string path to the kubeconfig file (default "~/.kube/config")