-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (27 loc) · 788 Bytes
/
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
DOCKER_IMG_NAME := toyrobot-app
DOCKER_CONTAINER_NAME := toyrobot-container
DOCKERFILE_PATH := ./build/Dockerfile
build-docker:
@docker build -f $(DOCKERFILE_PATH) -t $(DOCKER_IMG_NAME) .
run-docker: build-docker
@docker run -it --rm --name $(DOCKER_CONTAINER_NAME) $(DOCKER_IMG_NAME) play
test:
@go mod download
@go mod verify
@go test ./... -v
build:
@go mod download
@go mod verify
@go build -o $(DOCKER_IMG_NAME) .
run:
@go mod download
@go mod verify
@go build -o $(DOCKER_IMG_NAME) .
@./$(DOCKER_IMG_NAME) play
help:
@echo "Available commands:"
@echo "- build-docker: Build the Docker image"
@echo "- run-docker: Run the app inside a Docker container"
@echo "- test: Run tests"
@echo "- run: Run the app"
.PHONY: build-docker run-docker build test run help