-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (64 loc) · 2.02 KB
/
Makefile
File metadata and controls
78 lines (64 loc) · 2.02 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.DEFAULT_GOAL := help
USER = $(shell id -u):$(shell id -g)
DOCKER_COMPOSE = docker compose -f docker/development/docker-compose.yml
ifdef NODOCKER
PHP = php
COMPOSER = composer
else
PHP = ./docker/bin/php
COMPOSER = ./docker/bin/composer
endif
.PHONY: docker-start
docker-start: PORT ?= 8000
docker-start: .env ## Start a development server (can take a PORT argument)
@echo "Running webserver on http://localhost:$(PORT)"
$(DOCKER_COMPOSE) up
.PHONY: docker-build
docker-build: ## Rebuild the Docker image
$(DOCKER_COMPOSE) build --pull
.PHONY: docker-pull
docker-pull: ## Pull the Docker images from the Docker Hub
$(DOCKER_COMPOSE) pull --ignore-buildable
.PHONY: docker-clean
docker-clean: ## Clean the Docker stuff
$(DOCKER_COMPOSE) down -v
.PHONY: install
install: ## Install the dependencies
$(COMPOSER) install
.PHONY: db-setup
db-setup: .env ## Setup the application system
$(PHP) cli migrations setup --seed
.PHONY: db-rollback
db-rollback: ## Reverse the last migration (can take a STEPS argument)
ifdef STEPS
$(CLI) migrations rollback --steps=$(STEPS)
else
$(CLI) migrations rollback
endif
.PHONY: lint
lint: LINTER ?= all
lint: ## Run the linter on the PHP files (can take a LINTER argument)
ifeq ($(LINTER),$(filter $(LINTER), all phpstan))
$(PHP) ./vendor/bin/phpstan analyse --memory-limit 1G -c .phpstan.neon
endif
ifeq ($(LINTER), $(filter $(LINTER), all rector))
$(PHP) vendor/bin/rector process --dry-run --config .rector.php
endif
ifeq ($(LINTER),$(filter $(LINTER), all phpcs))
$(PHP) ./vendor/bin/phpcs
endif
.PHONY: release
release: ## Release a new version (take a VERSION argument)
ifndef VERSION
$(error You need to provide a "VERSION" argument)
endif
echo $(VERSION) > VERSION.txt
$(EDITOR) CHANGELOG.md
git add .
git commit -m "release: Publish version $(VERSION)"
git tag -a $(VERSION) -m "Release version $(VERSION)"
.PHONY: help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.env:
@cp env.sample .env