2017-06-15 07:47:30 +00:00
|
|
|
JOBDATE ?= $(shell date -u +%Y-%m-%dT%H%M%SZ)
|
|
|
|
GIT_REVISION = $(shell git rev-parse --short HEAD)
|
2017-07-22 20:40:54 +00:00
|
|
|
VERSION ?= $(shell git describe --tags --abbrev=0)
|
2017-06-15 07:47:30 +00:00
|
|
|
|
2018-10-07 15:50:56 +00:00
|
|
|
LDFLAGS += -s -w
|
2017-11-01 18:25:28 +00:00
|
|
|
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)
|
2017-06-15 07:47:30 +00:00
|
|
|
|
|
|
|
.PHONY: release
|
2017-06-10 11:24:03 +00:00
|
|
|
|
2018-10-07 15:50:56 +00:00
|
|
|
fetch-certs:
|
|
|
|
curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
|
|
|
|
cp cacert.pem ca-certificates.crt
|
|
|
|
|
|
|
|
compress:
|
|
|
|
upx --brute cmd/keel/release/keel-linux-arm
|
|
|
|
upx --brute cmd/keel/release/keel-linux-aarch64
|
|
|
|
|
|
|
|
build-binaries:
|
|
|
|
go get github.com/mitchellh/gox
|
|
|
|
@echo "++ Building keel binaries"
|
|
|
|
cd cmd/keel && 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
|
|
|
|
|
2018-10-14 13:01:00 +00:00
|
|
|
armhf-latest:
|
2018-10-07 15:50:56 +00:00
|
|
|
docker build -t keelhq/keel-arm:latest -f Dockerfile.armhf .
|
|
|
|
docker push keelhq/keel-arm:latest
|
|
|
|
|
2018-10-14 13:01:00 +00:00
|
|
|
aarch64-latest:
|
2018-10-07 15:50:56 +00:00
|
|
|
docker build -t keelhq/keel-aarch64:latest -f Dockerfile.aarch64 .
|
|
|
|
docker push keelhq/keel-aarch64:latest
|
|
|
|
|
2018-10-14 13:01:00 +00:00
|
|
|
armhf:
|
|
|
|
docker build -t keelhq/keel-arm:$(VERSION) -f Dockerfile.armhf .
|
|
|
|
docker push keelhq/keel-arm:$(VERSION)
|
|
|
|
|
|
|
|
aarch64:
|
|
|
|
docker build -t keelhq/keel-aarch64:$(VERSION) -f Dockerfile.aarch64 .
|
|
|
|
docker push keelhq/keel-aarch64:$(VERSION)
|
|
|
|
|
2018-10-07 15:50:56 +00:00
|
|
|
arm: build-binaries compress fetch-certs armhf aarch64
|
|
|
|
|
2019-04-25 16:16:02 +00:00
|
|
|
test:
|
2019-04-23 22:00:56 +00:00
|
|
|
# go test -v `go list ./... | egrep -v /tests`
|
2019-04-23 22:25:58 +00:00
|
|
|
go test -json -v `go list ./... | egrep -v /tests` -cover | tparse -all -smallscreen
|
2017-06-15 07:47:30 +00:00
|
|
|
|
2019-04-25 16:16:02 +00:00
|
|
|
build:
|
2017-06-15 07:47:30 +00:00
|
|
|
@echo "++ Building keel"
|
2019-04-25 16:16:02 +00:00
|
|
|
CGO_ENABLED=0 GOOS=linux cd cmd/keel && go build -a -tags netgo -ldflags "$(LDFLAGS) -w -s" -o keel .
|
2017-12-12 22:19:44 +00:00
|
|
|
|
2019-04-25 16:16:02 +00:00
|
|
|
install:
|
2017-12-12 22:19:44 +00:00
|
|
|
@echo "++ Installing keel"
|
2019-04-25 16:16:02 +00:00
|
|
|
CGO_ENABLED=0 GOOS=linux go install -ldflags "$(LDFLAGS)" github.com/keel-hq/keel/cmd/keel
|
2017-08-03 22:02:01 +00:00
|
|
|
|
|
|
|
image:
|
2018-03-09 11:41:28 +00:00
|
|
|
docker build -t keelhq/keel:alpha -f Dockerfile .
|
2017-08-03 22:02:01 +00:00
|
|
|
|
2018-05-28 16:17:08 +00:00
|
|
|
image-debian:
|
|
|
|
docker build -t keelhq/keel:alpha -f Dockerfile.debian .
|
|
|
|
|
2017-08-03 22:02:01 +00:00
|
|
|
alpha: image
|
2018-07-05 18:41:05 +00:00
|
|
|
@echo "++ Pushing keel alpha"
|
|
|
|
docker push keelhq/keel:alpha
|
|
|
|
|
|
|
|
gen-deploy:
|
|
|
|
deployment/scripts/gen-deploy.sh
|
2018-11-13 23:39:38 +00:00
|
|
|
|
|
|
|
e2e: install
|
2019-04-25 16:16:02 +00:00
|
|
|
cd tests && go test
|