Skip to content

Commit

Permalink
Add multiarch support
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghang8421 committed Feb 1, 2019
1 parent c56fe0e commit 1da5842
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .drone-multiarch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kind: pipeline
name: amd64

platform:
os: linux
arch: amd64

steps:
- name: build
image: golang:1.11
volumes:
- name: docker
path: /var/run/docker.sock
commands:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- mkdir -p $GOPATH/src/github.com/lrills/helm-unittest/
- cp -r ./ $GOPATH/src/github.com/lrills/helm-unittest/
- cd $GOPATH/src/github.com/lrills/helm-unittest/
- dep ensure
- make dist
- mkdir -p /drone/src/_dist/
- cp ./_dist/* /drone/src/_dist/
- name: github_binary_release
image: plugins/github-release:linux-amd64
settings:
api_key:
from_secret: github_token
files:
- $GOPATH/src/github.com/lrills/helm-unittest/_dist/*
checksum:
- sha256
when:
event: tag
volumes:
- name: docker
host:
path: /var/run/docker.sock
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ build:
dist:
mkdir -p $(DIST)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o untt -ldflags $(LDFLAGS) ./main.go
tar -zcvf $(DIST)/helm-unittest-linux-$(VERSION).tgz untt README.md LICENSE plugin.yaml
tar -zcvf $(DIST)/helm-unittest-linux-amd64-$(VERSION).tgz untt README.md LICENSE plugin.yaml
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o untt -ldflags $(LDFLAGS) ./main.go
tar -zcvf $(DIST)/helm-unittest-macos-$(VERSION).tgz untt README.md LICENSE plugin.yaml
tar -zcvf $(DIST)/helm-unittest-macos-amd64-$(VERSION).tgz untt README.md LICENSE plugin.yaml
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o untt.exe -ldflags $(LDFLAGS) ./main.go
tar -zcvf $(DIST)/helm-unittest-windows-$(VERSION).tgz untt.exe README.md LICENSE plugin.yaml
tar -zcvf $(DIST)/helm-unittest-windows-amd64-$(VERSION).tgz untt.exe README.md LICENSE plugin.yaml
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o untt -ldflags $(LDFLAGS) ./main.go
tar -zcvf $(DIST)/helm-unittest-linux-arm64-$(VERSION).tgz untt README.md LICENSE plugin.yaml

.PHONY: bootstrap
bootstrap:
Expand Down
4 changes: 2 additions & 2 deletions install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# borrowed from https://github.com/technosophos/helm-template

PROJECT_NAME="helm-unittest"
PROJECT_GH="lrills/$PROJECT_NAME"
PROJECT_GH="jianghang8421/$PROJECT_NAME"

: ${HELM_PLUGIN_PATH:="$(helm home)/plugins/helm-unittest"}

Expand Down Expand Up @@ -51,7 +51,7 @@ initOS() {
# verifySupported checks that the os/arch combination is supported for
# binary builds.
verifySupported() {
local supported="linux-amd64\nmacos-amd64\nwindows-amd64"
local supported="linux-arm64\linux-amd64\nmacos-amd64\nwindows-amd64"
if ! echo "${supported}" | grep -q "${OS}-${ARCH}"; then
echo "No prebuild binary for ${OS}-${ARCH}."
exit 1
Expand Down

0 comments on commit 1da5842

Please sign in to comment.