forked from swisscom/ip-whitelisting-route-service-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (46 loc) · 1.12 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
.DEFAULT_GOAL := run
SHELL := /bin/bash
APP ?= $(shell basename $$(pwd))
COMMIT_SHA = $(shell git rev-parse --short HEAD)
.PHONY: help
## help: prints this help message
help:
@echo "Usage:"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
.PHONY: run
## run: runs main.go with the race detector
run:
go run -race main.go
.PHONY: gin
## gin: runs main.go via gin (hot reloading)
gin:
SKIP_SSL_VALIDATION=true gin --all --immediate run main.go
.PHONY: build
## build: builds the application
build: clean
@echo "Building binary ..."
go build -o ${APP}
.PHONY: clean
## clean: cleans up binary files
clean:
@echo "Cleaning up ..."
@go clean
.PHONY: install
## install: installs the application
install:
@echo "Installing binary ..."
go install
.PHONY: test
## test: runs go test with the race detector
test:
GOARCH=amd64 GOOS=linux go test -v -race ./...
.PHONY: init
## init: sets up go modules
init:
@echo "Setting up modules ..."
@go mod init 2>/dev/null; go mod tidy && go mod vendor
.PHONY: push
## push: pushes the application onto Cloud Foundry
push:
@echo "Pushing application ..."
@cf push