Skip to content

Commit a5f5185

Browse files
committed
feat: add makefile
1 parent feb43c8 commit a5f5185

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
help:
2+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "⚡ \033[34m%-30s\033[0m %s\n", $$1, $$2}'
3+
4+
install: build run
5+
test: build run test
6+
7+
build: ## Build Docker image for local development
8+
docker-compose build
9+
10+
start: run
11+
run: ## Run application Docker. Run 'make build' first
12+
docker-compose up -d
13+
14+
status: ps
15+
ps: ### Alias of docker-composer ps command
16+
docker-compose ps
17+
18+
restart: ## Restart containers
19+
docker-compose restart
20+
21+
test: ### Run unit testing
22+
docker-compose exec app sh -c "composer test"
23+
24+
stop: ## Stop application running in Docker
25+
docker-compose kill
26+
27+
destroy: ## Alias docker-compose down command
28+
docker-compose down
29+
down: destroy
30+
31+
logs: ## View container logs
32+
docker-compose logs -ft app
33+
34+
shell: ## Enter bash in running Docker container
35+
docker-compose exec app sh
36+
37+
root: ## Enter bash in running Docker container as root user
38+
docker-compose exec --user root app sh

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@ QUERY_LOGGER_ENABLED=false
3838

3939
## Test
4040

41+
- Without Docker
42+
4143
```bash
4244
composer test
4345
```
4446

47+
- With Docker
48+
49+
```bash
50+
make test
51+
```
52+
4553
## Credits
4654

4755
- [Ngoc Linh Pham](https://github.com/pnlinh)

0 commit comments

Comments
 (0)