diff --git a/.drone.yml b/.drone.yml index 5379691d..0ba4eb86 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,6 +33,33 @@ steps: password: from_secret: docker_password +- name: build-arm + image: golang:1.12.0 + commands: + - make arm + +- name: publish-arm-image + image: plugins/docker + settings: + repo: keelhq/keel-arm + dockerfile: dockerfile.armhf + auto_tag: true + username: + from_secret: docker_username + password: + from_secret: docker_password + +- name: publish-aarch64-image + image: plugins/docker + settings: + repo: keelhq/keel-aarch64 + dockerfile: dockerfile.aarch64 + auto_tag: true + username: + from_secret: docker_username + password: + from_secret: docker_password + - name: slack image: plugins/slack when: diff --git a/.gitignore b/.gitignore index 1ad1f26a..7aaeea90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .kubeconfig deployment.yml .test_env.sh +cmd/keel/release hack/deployment-norbac.yaml hack/deployment-rbac.yaml hack/deployment-norbac-helm.yaml diff --git a/Makefile b/Makefile index 1e55877c..30d58d6a 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,11 @@ LDFLAGS += -X github.com/keel-hq/keel/version.Version=$(VERSION) LDFLAGS += -X github.com/keel-hq/keel/version.Revision=$(GIT_REVISION) LDFLAGS += -X github.com/keel-hq/keel/version.BuildDate=$(JOBDATE) +ARMFLAGS += -a -v +ARMFLAGS += -X github.com/keel-hq/keel/version.Version=$(VERSION) +ARMFLAGS += -X github.com/keel-hq/keel/version.Revision=$(GIT_REVISION) +ARMFLAGS += -X github.com/keel-hq/keel/version.BuildDate=$(JOBDATE) + .PHONY: release fetch-certs: @@ -20,10 +25,12 @@ compress: build-binaries: go get github.com/mitchellh/gox @echo "++ Building keel binaries" - cd cmd/keel && gox -verbose -output="release/{{.Dir}}-{{.OS}}-{{.Arch}}" \ + cd cmd/keel && CC=arm-linux-gnueabi-gcc gox -verbose -output="release/{{.Dir}}-{{.OS}}-{{.Arch}}" \ -ldflags "$(LDFLAGS)" -osarch="linux/arm" - @echo "++ building aarch64 binary" - cd cmd/keel && env GOARCH=arm64 GOOS=linux go build -ldflags="-s -w" -o release/keel-linux-aarch64 + +build-arm: + cd cmd/keel && env GOARCH=arm GOOS=linux go build -ldflags="$(ARMFLAGS)" -o release/keel-linux-arm + cd cmd/keel && env GOARCH=arm64 GOOS=linux go build -ldflags="$(ARMFLAGS)" -o release/keel-linux-aarc64 armhf-latest: docker build -t keelhq/keel-arm:latest -f Dockerfile.armhf . @@ -41,7 +48,7 @@ aarch64: docker build -t keelhq/keel-aarch64:$(VERSION) -f Dockerfile.aarch64 . docker push keelhq/keel-aarch64:$(VERSION) -arm: build-binaries compress fetch-certs armhf aarch64 +arm: build-arm fetch-certs armhf aarch64 test: go get github.com/mfridman/tparse