Skip to content

Commit

Permalink
Add darwin/arm64, linux/arm64 and linux/arm for krew support platform (
Browse files Browse the repository at this point in the history
  • Loading branch information
superbrothers authored May 9, 2021
1 parent 03533de commit 0aec22d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 37 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ test:
.PHONY: dist
dist: $(GORELEASER) $(GOMPLATE)
$(GORELEASER) release --rm-dist --skip-publish --snapshot
$(MAKE) manifest

.PHONY: manifest
manifest:
GIT_VERSION=$(GIT_VERSION) $(GOMPLATE) -f ./hack/sort-manifests.yaml.tmpl > $(DIST_DIR)/sort-manifests.yaml

.PHONY: clean
Expand Down
53 changes: 16 additions & 37 deletions hack/sort-manifests.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{{- define "platform" -}}
- uri: https://github.com/superbrothers/ksort/releases/download/{{ env.Getenv "GIT_VERSION" }}/ksort-{{ .os }}-{{ .arch }}.zip
sha256: {{ . | tmpl.Inline "./dist/ksort-{{ .os }}-{{ .arch }}.zip" | file.Read | crypto.SHA256 }}
bin: ksort{{ if eq .os "windows" }}.exe{{ end }}
selector:
matchLabels:
os: {{ .os }}
arch: {{ .arch }}
{{- end -}}
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: sort-manifests
spec:
version: {{ .Env.GIT_VERSION }}
version: {{ env.Getenv "GIT_VERSION" }}
shortDescription: Sort manifest files in a proper order by Kind
description: |
When installing manifests, they should be sorted in a proper order by Kind.
Expand All @@ -14,39 +23,9 @@ spec:
using tiller.SortByKind() in Kubernetes Helm.
homepage: https://github.com/superbrothers/ksort
platforms:
- uri: https://github.com/superbrothers/ksort/releases/download/{{ .Env.GIT_VERSION }}/ksort-darwin-amd64.zip
sha256: {{ file.Read "./dist/ksort-darwin-amd64.zip" | crypto.SHA256 }}
bin: ksort
files:
- from: ksort
to: .
- from: LICENSE.txt
to: .
selector:
matchLabels:
os: darwin
arch: amd64
- uri: https://github.com/superbrothers/ksort/releases/download/{{ .Env.GIT_VERSION }}/ksort-linux-amd64.zip
sha256: {{ file.Read "./dist/ksort-linux-amd64.zip" | crypto.SHA256 }}
bin: ksort
files:
- from: ksort
to: .
- from: LICENSE.txt
to: .
selector:
matchLabels:
os: linux
arch: amd64
- uri: https://github.com/superbrothers/ksort/releases/download/{{ .Env.GIT_VERSION }}/ksort-windows-amd64.zip
sha256: {{ file.Read "./dist/ksort-windows-amd64.zip" | crypto.SHA256 }}
bin: ksort.exe
files:
- from: ksort.exe
to: .
- from: LICENSE.txt
to: .
selector:
matchLabels:
os: windows
arch: amd64
{{ template "platform" (dict "os" "darwin" "arch" "amd64") }}
{{ template "platform" (dict "os" "darwin" "arch" "arm64") }}
{{ template "platform" (dict "os" "linux" "arch" "amd64") }}
{{ template "platform" (dict "os" "linux" "arch" "arm64") }}
{{ template "platform" (dict "os" "linux" "arch" "arm") }}
{{ template "platform" (dict "os" "windows" "arch" "amd64") }}

0 comments on commit 0aec22d

Please sign in to comment.