keel/Makefile

98 lines
2.9 KiB
Makefile
Raw Normal View History

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
2019-05-28 11:46:01 +00:00
LDFLAGS += -linkmode external -extldflags -static
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
2019-09-29 20:48:28 +00:00
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)
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"
2019-09-29 20:48:28 +00:00
cd cmd/keel && CC=arm-linux-gnueabi-gcc gox -verbose -output="release/{{.Dir}}-{{.OS}}-{{.Arch}}" \
2018-10-07 15:50:56 +00:00
-ldflags "$(LDFLAGS)" -osarch="linux/arm"
2019-09-29 20:48:28 +00:00
build-arm:
2020-03-02 23:44:15 +00:00
cd cmd/keel && env CC=arm-linux-gnueabihf-gcc CGO_ENABLED=1 GOARCH=arm GOOS=linux go build -ldflags="$(ARMFLAGS)" -o release/keel-linux-arm
# disabling for now 64bit builds
# cd cmd/keel && env GOARCH=arm64 GOOS=linux go build -ldflags="$(ARMFLAGS)" -o release/keel-linux-aarc64
2018-10-07 15:50:56 +00:00
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 .
2020-03-02 23:44:15 +00:00
# docker push keelhq/keel-arm:$(VERSION)
2018-10-14 13:01:00 +00:00
aarch64:
docker build -t keelhq/keel-aarch64:$(VERSION) -f Dockerfile.aarch64 .
docker push keelhq/keel-aarch64:$(VERSION)
2019-09-29 20:48:28 +00:00
arm: build-arm fetch-certs armhf aarch64
2018-10-07 15:50:56 +00:00
2019-04-25 16:16:02 +00:00
test:
2019-04-27 07:10:27 +00:00
go get github.com/mfridman/tparse
2019-08-18 22:26:50 +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-05-09 15:58:40 +00:00
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-05-28 11:46:01 +00:00
# CGO_ENABLED=0 GOOS=linux go install -ldflags "$(LDFLAGS)" github.com/keel-hq/keel/cmd/keel
GOOS=linux go install -ldflags "$(LDFLAGS)" github.com/keel-hq/keel/cmd/keel
image:
docker build -t keelhq/keel:alpha -f Dockerfile .
image-debian:
docker build -t keelhq/keel:alpha -f Dockerfile.debian .
alpha: image
@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-26 17:50:55 +00:00
cd tests && go test
run: install
2020-03-02 23:44:15 +00:00
keel --no-incluster --ui-dir ui/dist
2019-05-28 11:46:01 +00:00
lint-ui:
cd ui && yarn
yarn run lint --no-fix && yarn run build
run-ui:
cd ui && yarn run serve
build-ui:
docker build -t keelhq/keel:ui -f Dockerfile .
docker push keelhq/keel:ui
2019-04-28 16:03:23 +00:00
run-debug: install
2019-04-26 22:47:45 +00:00
DEBUG=true keel --no-incluster