-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
60 lines (46 loc) · 1.41 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
GOLANG_VERSION=$(shell cat GOLANG_VERSION)
all: build test
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: clean
clean: ## Clean the workspace
rm -rf build
build/unir: ## Build the main application
build/unir: cmd/unir/main.go
mkdir -p build
go build -v -o $@ $<
build: ## Build all targets
build: build/unir
.PHONY: install
install:
go install -v ./...
.PHONY: test
test: ## Run all tests
go test -v ./...
.PHONY: image
image: ## Make docker image
image: clean
docker build --build-arg "GOLANG_VERSION=$(GOLANG_VERSION)" -t seemethere/unir:dev .
.PHONY: run-dev
run-dev: ## Run server in development mode
run-dev: image
docker run --rm -i -p 8080:8080 --name unir-dev -e UNIR_WEBHOOK_SECRET -e UNIR_CLIENT_TOKEN seemethere/unir:dev -debug
.PHONY: run-test
run-test: ## Run server in test mode (can be used as a webhook)
run-test: image
docker run --rm -i -p 8080:8080 --name unir-dev -e UNIR_WEBHOOK_SECRET -e UNIR_INTEGRATION_ID seemethere/unir:dev -debug -test
.PHONY: release
release: # Release images to Docker Hub
release: VERSION
VERSION=$(shell cat $<) ./release.sh
$(RM) CHANGELOG.md
$(MAKE) CHANGELOG.md
CHANGELOG.md:
docker run --rm \
--interactive \
--tty \
--net "host" \
-v "$(CURDIR):$(CURDIR)" \
-w $(CURDIR) \
-it muccg/github-changelog-generator -u seemethere -p unir