-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (53 loc) · 1.72 KB
/
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
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
61
62
63
64
65
66
67
.PHONY: build
build: ## builds the containers
docker compose build --pull
.PHONY: up
up: ## starts the containers
docker compose up -d
.PHONY: stop
stop: ## stops the containers
docker compose stop
.PHONY: clean
clean: ## stops and obliterates the containers
docker-compose down --volumes --remove-orphans --rmi local
.PHONY: setup
setup: ## app-specific setup
cp -n .env.example .env || true
.PHONY: install
install: ## installs the application
@echo 'Building the app...'
@make setup
@make build
@make up
@make vendor
@make migrate
@echo '✓ The app has been installed.'
.PHONY: reinstall
reinstall: ## reinstalls the application
@echo 'Reinstalling the app...'
@make clean
@make install
.PHONY: migrate
migrate: ## migrates the database
docker compose run --rm php php artisan migrate
.PHONY: migrate-force
migrate-force: ## migrates the database forcefully
docker compose run --rm php php artisan migrate --force
.PHONY: tests
tests: ## runs the tests
docker compose run --rm php-test php artisan test
.PHONY: shell
shell: ## opens a shell in the php container
docker exec -it php /bin/bash
.PHONY: import
import: ## runs the importer
docker compose run --rm php php artisan app:import-products --csvPath=/var/www/html/public/input.csv
.PHONY: generate-requirements
generate-requirements: ## runs the generate requirements command
docker compose run --rm php php artisan app:generate-requirements
.PHONY: vendor
vendor: ## runs composer install in the php container
docker compose run --rm php composer install && composer validate --ansi
.PHONY: help
help: ## Shows this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'