-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 1.23 KB
/
Makefile
File metadata and controls
65 lines (52 loc) · 1.23 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
MAKEFILE_PATH := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
PATH := $(MAKEFILE_PATH):$(PATH)
export GOBIN := $(MAKEFILE_PATH)/bin
PATH := $(GOBIN):$(PATH)
.PHONY: all
all: clean format build lint test
.PHONY: clean
clean:
@echo clean
@go clean
.PHONY: build
build:
@echo build
@go build -o $(GOBIN)/import-gitlab-commits
.PHONY: docker-build
docker-build:
@echo docker-build
@docker build -t github.com/alexandear/import-gitlab-commits .
.PHONY: docker-run
docker-run: docker-build
@echo docker-run
@docker run --rm \
-e GITLAB_BASE_URL="${GITLAB_BASE_URL}" \
-e GITLAB_TOKEN="${GITLAB_TOKEN}" \
-e COMMITTER_NAME="${COMMITTER_NAME}" \
-e COMMITTER_EMAIL="${COMMITTER_EMAIL}" \
-v $$(pwd)/output:/root \
github.com/alexandear/import-gitlab-commits
.PHONY: test
test:
@echo test
@go test -shuffle=on -count=1 -race -v ./...
.PHONY: test-integration
test-integration:
@echo test-integration
@go test -tags=integration -run=TestGitLab -shuffle=on -count=1 -race -v ./...
.PHONY: lint
lint:
@echo lint
@go tool -modfile=tools/go.mod golangci-lint run
.PHONY: format
format:
@echo format
@go fmt $(PKGS)
.PHONY: generate
generate:
@echo generate
@go generate ./...
.PHONY: run
run:
@echo run
@go run -race .