From 8a283b64d07a893d25ecc4b2ccffbfc17f908175 Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sat, 1 Feb 2020 20:08:16 +0530 Subject: [PATCH 1/5] update golang version to 1.13 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9142fc1e..f8e59a71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: working_directory: /go/src/github.com/robscott/kube-capacity docker: - - image: circleci/golang:1.12 + - image: circleci/golang:1.13 steps: - checkout From 28b4e297f0e26ceb8a48612c24e032167602e131 Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sat, 1 Feb 2020 20:12:57 +0530 Subject: [PATCH 2/5] setup go-releaser and fix deprecated/removed configs --- .circleci/config.yml | 18 +++++++++++++++++- .goreleaser.yml | 30 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8e59a71..ac0c5548 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,8 +14,24 @@ jobs: - run: go list ./... | grep -v vendor | xargs go vet - run: go test ./pkg/... -v -coverprofile cover.out + release: + working_directory: /go/src/github.com/robscott/kube-capacity + + docker: + - image: circleci/golang:1.13 + + steps: + - checkout + - run: curl -sL https://git.io/goreleaser | bash + workflows: version: 2 - test: + main: jobs: - test + - release: + filters: + branches: + ignore: /.*/ + tags: + only: /[0-9]+(\.[0-9]+)*(-.*)*/ \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 72918eb6..3178542a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,13 +1,13 @@ builds: - env: - CGO_ENABLED=0 -archive: - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 checksum: name_template: 'checksums.txt' snapshot: @@ -18,11 +18,11 @@ changelog: exclude: - '^docs:' - '^test:' -brew: - github: - owner: robscott - name: homebrew-tap - folder: Formula - description: kube-capacity provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster - test: | - system "#{bin}/kube-capacity version" +brews: + - github: + owner: robscott + name: homebrew-tap + folder: Formula + description: kube-capacity provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster + test: | + system "#{bin}/kube-capacity version" From 2e8b7cddd699c867f5aee0ef0257f529791558cd Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sat, 1 Feb 2020 20:15:11 +0530 Subject: [PATCH 3/5] add krew-release-bot --- .circleci/config.yml | 30 +++++++++++++++++++++++++++++- .krew.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .krew.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index ac0c5548..37f4100d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,14 +24,42 @@ jobs: - checkout - run: curl -sL https://git.io/goreleaser | bash + + update-krew-index: + working_directory: /go/src/github.com/robscott/kube-capacity + + docker: + - image: circleci/golang:1.13 + environment: + KREW_RELEASE_BOT_WEBHOOK_URL: https://krew-release-bot-dryrun.rajatjindal.com/github-action-webhook + KREW_RELEASE_BOT_VERSION: v0.0.34-4 + steps: + - checkout + - run: | + echo "using krew-release-bot version ${KREW_RELEASE_BOT_VERSION}" + curl -LO https://github.com/rajatjindal/krew-release-bot/releases/download/${KREW_RELEASE_BOT_VERSION}/krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz + tar -xvf krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz + - run: ./krew-release-bot action + + workflows: version: 2 main: jobs: - test + - release: filters: branches: ignore: /.*/ tags: - only: /[0-9]+(\.[0-9]+)*(-.*)*/ \ No newline at end of file + only: /[0-9]+(\.[0-9]+)*(-.*)*/ + + - update-krew-index: + requires: + - release + filters: + branches: + ignore: /.*/ + tags: + only: /[0-9]+(\.[0-9]+)*(-.*)*/ \ No newline at end of file diff --git a/.krew.yaml b/.krew.yaml new file mode 100644 index 00000000..98a169f3 --- /dev/null +++ b/.krew.yaml @@ -0,0 +1,29 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: resource-capacity +spec: + version: v{{ .TagName }} + homepage: https://github.com/robscott/kube-capacity + shortDescription: Provides an overview of resource requests, limits, and utilization + platforms: + - selector: + matchLabels: + os: darwin + arch: amd64 + bin: kube-capacity + files: + - from: "*" + to: "." + {{addURIAndSha "https://github.com/robscott/kube-capacity/releases/download/{{ .TagName }}/kube-capacity_{{ .TagName }}_Darwin_x86_64.tar.gz" .TagName }} + - selector: + matchLabels: + os: linux + arch: amd64 + bin: kube-capacity + files: + - from: "*" + to: "." + {{addURIAndSha "https://github.com/robscott/kube-capacity/releases/download/{{ .TagName }}/kube-capacity_{{ .TagName }}_Linux_x86_64.tar.gz" .TagName }} + description: | + A simple CLI that provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster. \ No newline at end of file From fa4cf0bbe3ddee4708cbf6bb3b513c13d04c7d2d Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sat, 1 Feb 2020 20:21:50 +0530 Subject: [PATCH 4/5] run release after tests pass --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37f4100d..292d382b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,9 +46,13 @@ workflows: version: 2 main: jobs: - - test - + - test: + filters: + tags: + only: /.*/ - release: + requires: + - test filters: branches: ignore: /.*/ From 291cd243a6ce3c4ea65325cd8e0ae1672136a9cd Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sun, 2 Feb 2020 10:16:24 +0530 Subject: [PATCH 5/5] use v0.0.35 of krew release bot --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 292d382b..1dec13a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,8 +31,7 @@ jobs: docker: - image: circleci/golang:1.13 environment: - KREW_RELEASE_BOT_WEBHOOK_URL: https://krew-release-bot-dryrun.rajatjindal.com/github-action-webhook - KREW_RELEASE_BOT_VERSION: v0.0.34-4 + KREW_RELEASE_BOT_VERSION: v0.0.35 steps: - checkout - run: |