-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (43 loc) · 1.97 KB
/
Makefile
File metadata and controls
60 lines (43 loc) · 1.97 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Makefile
DOCKER_COMPOSE_PREFIX ?= IMAGES_PREFIX=ghcr.io/pbxg33k/php-download-router XDEBUG_MODE=debug
ENV ?=
up:
$(DOCKER_COMPOSE_PREFIX) docker compose up --wait -d
logs:
$(DOCKER_COMPOSE_PREFIX) docker compose logs -f
down:
$(DOCKER_COMPOSE_PREFIX) docker compose down
clean:
$(DOCKER_COMPOSE_PREFIX) docker compose down -v --remove-orphans
clean-images:
$(DOCKER_COMPOSE_PREFIX) docker compose down -v --rmi all --remove-orphans
restart:
$(DOCKER_COMPOSE_PREFIX) docker compose down
$(DOCKER_COMPOSE_PREFIX) docker compose up --wait -d
# Run the ./update-deps.sh script with prefix to update dependencies
update-deps:
$(DOCKER_COMPOSE_PREFIX) ./update-deps.sh $(ENV)
force-recreate:
$(DOCKER_COMPOSE_PREFIX) docker compose up --force-recreate --wait -d
.PHONY: build
build:
$(DOCKER_COMPOSE_PREFIX) docker compose build --no-cache --pull
rebuild: clean-images build up
prep-test:
$(DOCKER_COMPOSE_PREFIX) docker compose exec -T api bin/console -e test doctrine:database:create
$(DOCKER_COMPOSE_PREFIX) docker compose exec -T api bin/console -e test doctrine:migrations:migrate --no-interaction
$(DOCKER_COMPOSE_PREFIX) docker compose exec -T api bin/console -e test doctrine:fixtures:load --no-interaction
test:
$(DOCKER_COMPOSE_PREFIX) docker compose exec --env XDEBUG_MODE=coverage -it api ./bin/phpunit --colors=always --testdox
integration:
docker run --network host -w /app -v ./e2e:/app --rm --ipc=host mcr.microsoft.com/playwright:v1.50.0-noble /bin/sh -c 'npm i; npx playwright test;'
bake:
$(DOCKER_COMPOSE_PREFIX) docker buildx bake --file compose.yaml --file compose.prod.yaml --file ./docker-bake.hcl
# Run command in the api container (ie: bin/console doctrine:migrations:migrate)
Arguments := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
.PHONY: api
api:
$(DOCKER_COMPOSE_PREFIX) docker compose run --entrypoint="" --rm -it api $(Arguments)
.PHONY: worker
worker:
$(DOCKER_COMPOSE_PREFIX) docker compose run --entrypoint="" --rm -it worker $(Arguments)