Skip to content

Commit

Permalink
Merge pull request #26 from rajatjindal/setup-krew-bot
Browse files Browse the repository at this point in the history
changes to do automated releases
  • Loading branch information
robscott committed Feb 15, 2020
2 parents 86e9ce8 + 291cd24 commit 5ca04c6
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 18 deletions.
53 changes: 50 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,8 +14,55 @@ 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


update-krew-index:
working_directory: /go/src/github.com/robscott/kube-capacity

docker:
- image: circleci/golang:1.13
environment:
KREW_RELEASE_BOT_VERSION: v0.0.35
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
test:
main:
jobs:
- test
- test:
filters:
tags:
only: /.*/
- release:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /[0-9]+(\.[0-9]+)*(-.*)*/

- update-krew-index:
requires:
- release
filters:
branches:
ignore: /.*/
tags:
only: /[0-9]+(\.[0-9]+)*(-.*)*/
30 changes: 15 additions & 15 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"
29 changes: 29 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 5ca04c6

Please sign in to comment.