mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-14 06:07:36 +08:00
- util/cli.go: RunMark() now maps CLI flags into mark.Config and delegates to mark.Run(); all core processing logic removed - util/cli_test.go: absorb Test_setLogLevel from deleted main_test.go - main.go, main_test.go: removed (entry point is now cmd/mark/main.go) - Makefile: update build target to ./cmd/mark with -o mark Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
47 lines
1006 B
Makefile
47 lines
1006 B
Makefile
NAME = $(notdir $(PWD))
|
|
|
|
VERSION = $(shell git describe --tags --abbrev=0)
|
|
COMMIT = $(shell git rev-parse HEAD)
|
|
GO111MODULE = on
|
|
|
|
REMOTE = kovetskiy
|
|
|
|
version:
|
|
@echo $(VERSION)
|
|
|
|
get:
|
|
go get -v -d
|
|
|
|
build:
|
|
@echo :: building go binary $(VERSION)
|
|
CGO_ENABLED=0 go build \
|
|
-ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)" \
|
|
-gcflags "-trimpath $(GOPATH)/src" \
|
|
-o mark \
|
|
./cmd/mark
|
|
|
|
test:
|
|
go test -race -coverprofile=profile.cov ./... -v
|
|
|
|
image:
|
|
@echo :: building image $(NAME):$(VERSION)
|
|
@docker build -t $(NAME):$(VERSION) -f Dockerfile .
|
|
docker tag $(NAME):$(VERSION) $(NAME):latest
|
|
|
|
push:
|
|
$(if $(REMOTE),,$(error REMOTE is not set))
|
|
$(eval VERSION ?= latest)
|
|
$(eval TAG ?= $(REMOTE)/$(NAME):$(VERSION))
|
|
@echo :: pushing image $(TAG)
|
|
@docker tag $(NAME):$(VERSION) $(TAG)
|
|
@docker push $(TAG)
|
|
@docker tag $(NAME):$(VERSION) $(REMOTE)/$(NAME):latest
|
|
@docker push $(REMOTE)/$(NAME):latest
|
|
|
|
release: image push
|
|
git tag -f $(VERSION)
|
|
git push --tags
|
|
|
|
clean:
|
|
rm -rf $(NAME)
|