-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 1.32 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
.PHONY: all clean test
all: assemble
lint:
@echo "\nApplying golint\n"
@golint ./...
integration-test:
@echo "\nRunning integration tests\n"
@go test -cover -run Integration ./...
unit-test:
@echo "\nRunning unit tests\n"
@go test -cover -short ./...
test: unit-test integration-test
@echo "\nRunning tests\n"
build:
@echo "\nBuilding application"
@go build -o application cmd/main.go
assemble: clean
@echo "\nCreating Docker container"
@docker build --tag authorizer .
@printf "\nContainer created. Run %bmake install%b to install authorizer\n" "\e[1;33m" "\e[0m"
install:
@echo "\nCreating executable"
@$(shell scripts/link_script.sh)
@echo "\nCreating acceptance test link"
@ln -s scripts/acceptance_tests.sh acceptance_tests
@echo "\nGiven execution permission to executable file"
@chmod +x authorizer
@printf "\nAll setup. %bauthorizer%b is ready\n %b./authorizer < EVENTS_FILE%b to use\n" "\e[1;32m" "\e[0m" "\e[1;32m" "\e[0m"
clean:
@echo "\nRemove acceptance tests link"
-@rm acceptance_tests 2>/dev/null || echo "\nAcceptance tests link not found to remove"
@echo "\nRemove authorizer executable"
-@rm authorizer 2>/dev/null || echo "\nExecutable file authorizer not found to remove"
@echo "\nRemove authorizer image"
-@docker rmi authorizer 2>/dev/null || echo "\nDocker image authorizer not found to remove"