0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/Makefile

51 lines
1.3 KiB
Makefile
Raw Normal View History

2019-06-20 18:36:40 -05:00
export GO111MODULE=on
TOP_LEVEL=$(shell git rev-parse --show-toplevel)
CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker)
PATH := bin:$(PATH)
2019-06-20 18:36:40 -05:00
.PHONY: all
all: doc binary debug test check
.PHONY: binary
binary: doc
go build -v -o bin/zot -tags=jsoniter ./cmd/zot
.PHONY: debug
debug: doc
go build -v -gcflags all='-N -l' -o bin/zot-debug -tags=jsoniter ./cmd/zot
2019-06-20 18:36:40 -05:00
.PHONY: test
test:
$(shell cd test/data; ./gen_certs.sh; cd ${TOP_LEVEL})
go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./...
2019-06-20 18:36:40 -05:00
.PHONY: check
check:
golangci-lint --version || curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1
golangci-lint run --enable-all ./cmd/... ./pkg/...
2019-06-20 18:36:40 -05:00
2019-08-28 17:58:00 -05:00
docs/docs.go:
swag -v || go install github.com/swaggo/swag/cmd/swag
2019-06-20 18:36:40 -05:00
swag init -g pkg/api/routes.go
2019-08-28 17:58:00 -05:00
.PHONY: doc
doc: docs/docs.go
2019-06-20 18:36:40 -05:00
.PHONY: clean
clean:
2019-08-28 17:58:00 -05:00
rm -f bin/zot* docs/*
2019-06-20 18:36:40 -05:00
.PHONY: run
run: binary test
./bin/zot serve examples/config-test.json
.PHONY: binary-container
binary-container:
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile -t zot:latest .
${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/go/src/github.com/anuvu/zot \
zot:latest make
.PHONY: binary-stacker
binary-stacker:
stacker build --substitute PWD=$$PWD --no-cache