-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 829 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (23 loc) · 829 Bytes
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
go ?= 1.21
.PHONY: up run test coverage
help:
@echo "Available options:"
@echo " make up"
@echo " make up go=$(go)"
@echo " make test"
@echo " make coverage"
up:
docker rm -f go-crontab > /dev/null 2>&1
docker build . -t go-crontab-image --build-arg GO_VERSION=$(go)
docker run --interactive --detach --volume $(shell pwd):/app --name go-crontab go-crontab-image
test:
docker exec -ti go-crontab go test ./crontab/...
coverage:
docker exec -ti go-crontab go test ./crontab/... -coverprofile=dev/coverage.txt
docker exec -ti go-crontab go tool cover -html=dev/coverage.txt -o=dev/coverage.html
sudo chown $$USER dev/coverage.html
firefox dev/coverage.html
update:
echo "Check the GO version in the Dockerfile"
docker exec -ti go-crontab go get -u ./crontab
docker exec -ti go-crontab go mod tidy