forked from neunhoef/arangocopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (32 loc) · 1019 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL = bash
PROJECT := arangocopy
COMMIT := $(shell git rev-parse --short HEAD)
DOCKERIMAGE ?= $(shell zutano docker image --name=$(PROJECT))
all: binaries
clean:
rm -Rf bin
binaries:
CGO_ENABLED=0 gox \
-osarch="linux/amd64 linux/arm darwin/amd64 windows/amd64" \
-ldflags="-X main.projectVersion=${VERSION} -X main.projectBuild=${COMMIT}" \
-output="bin/{{.OS}}/{{.Arch}}/$(PROJECT)" \
-tags="netgo" \
./...
mkdir -p assets
zip -r assets/arangocopy.zip bin/*
.PHONY: test
test:
mkdir -p bin/test
go test -coverprofile=bin/test/coverage.out -v ./... | tee bin/test/test-output.txt ; exit "$${PIPESTATUS[0]}"
cat bin/test/test-output.txt | go-junit-report > bin/test/unit-tests.xml
go tool cover -html=bin/test/coverage.out -o bin/test/coverage.html
bootstrap:
go get github.com/mitchellh/gox
go get github.com/jstemmer/go-junit-report
go get github.com/arangodb/go-driver
docker:
docker build \
--build-arg=GOARCH=amd64 \
-t $(DOCKERIMAGE) .
docker-push:
docker push $(DOCKERIMAGE)