-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.43 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
.DEFAULT_GOAL := help
GOLANGCI_LINT_TIMEOUT ?= 1m
.PHONY: build
build: ## Build cli
go build .
.PHONY: install
install: ## Install raccoon locally
go install .
.PHONY: test
test: ## Launch go unit tests suite
go test ./... -cover
.PHONY: lint
lint: ## Lint go code
golangci-lint run -c .golangci.yaml --timeout $(GOLANGCI_LINT_TIMEOUT)
.PHONY: doc
doc: ## Launch godoc
godoc -http=:6060
.PHONY: clean
clean: ## Cleanup
go clean
.PHONY: dev
dev: build lint test ## Validate your code while developing
.PHONY: aws-login
aws-login: ## Sign in on AWS ECR
aws ecr get-login-password --region us-east-1 | \
docker login --password-stdin -u AWS $(ECR_REPOSITORY)
.PHONY: docker-build
docker-build: ## Build docker image raccoon
docker build --no-cache -t raccoon:latest .
.PHONY: docker-push
docker-push: ## Tag as latest & push last raccoon local images to AWS ECR
@if [ -z "$$CIRCLE_TAG" ]; then \
echo '$$CIRCLE_TAG env variable not set, aborting docker-push target execution'; \
else \
docker tag raccoon:latest ${ECR_REPOSITORY}/raccoon:latest; \
docker tag raccoon:latest ${ECR_REPOSITORY}/raccoon:$$CIRCLE_TAG; \
docker push ${ECR_REPOSITORY}/raccoon:latest; \
docker push ${ECR_REPOSITORY}/raccoon:$$CIRCLE_TAG; \
fi
.PHONY: help
help: ## Help gives you the list of available targets
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'