-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 1.54 KB
/
Makefile
File metadata and controls
46 lines (34 loc) · 1.54 KB
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
.PHONY: up down install format test-unit test-integration shell clean
IMAGE_NAME := photos-mover
CONTAINER_NAME := photos-mover
up:
docker build -t $(IMAGE_NAME) .
down:
docker rm -f $(CONTAINER_NAME) 2>/dev/null || true
docker rmi $(IMAGE_NAME) 2>/dev/null || true
install:
docker run --rm -v $(PWD):/app --entrypoint composer $(IMAGE_NAME) install
test-unit:
docker run --rm -v $(PWD):/app --entrypoint ./vendor/bin/phpunit $(IMAGE_NAME) --testsuite unit
test-integration:
docker run --rm -v $(PWD):/app --entrypoint ./vendor/bin/phpunit $(IMAGE_NAME) --testsuite integration
shell:
docker run --rm -it -v $(PWD):/app --entrypoint bash $(IMAGE_NAME)
format:
docker run --rm -v $(PWD):/app --entrypoint sh $(IMAGE_NAME) -c "vendor/bin/mago lint --fix --potentially-unsafe && vendor/bin/rector && vendor/bin/mago format"
quality:
docker run --rm -v $(PWD):/app --entrypoint sh $(IMAGE_NAME) -c "vendor/bin/mago analyze"
clean: down
rm -rf vendor/
rm -f composer.lock
.DEFAULT_GOAL := help
help:
@echo "Available commands:"
@echo " make up - Build Docker image"
@echo " make down - Remove containers and images"
@echo " make install - Install composer dependencies"
@echo " make format - Auto format/refactor code"
@echo " make test-unit - Run unit tests"
@echo " make test-integration - Run integration tests"
@echo " make shell - Open interactive shell in container"
@echo " make clean - Remove everything (images, containers, vendor, locks)"