forked from smartrecruiters/rabbitr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 965 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
41
42
43
44
45
FILES := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
APP_NAME=rabbitr
VERSION=1.4.0
.PHONY: all test build fmt install release ci lint install-lint
all: install fmt build test
install:
@echo "Installing dependencies"
go get -v ./...
fmt:
@echo "Formating source code"
@goimports -l -w $(FILES)
install-lint:
@echo "Installing golinter"
go get -v golang.org/x/lint/golint
lint:
@echo "Executing golint"
golint cmd/...
test:
@echo "Running tests"
go test -v ./... && echo "TESTS PASSED"
build: test
@echo "Building sources"
go build -v ./...
ci: build test lint
release: build
@echo "Releasing rabbitr in $(VERSION) version"
git tag -a "$(VERSION)" -m "$(APP_NAME)@(VERSION) Release"
goreleaser release --rm-dist
snapshot: build
@echo "Building snapshot version"
git tag -a "$(VERSION)-SNAPSHOT" -m "$(APP_NAME)@(VERSION) Release"
goreleaser release --rm-dist --snapshot --skip-publish
git tag -d "$(VERSION)-SNAPSHOT"