This repository was archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (56 loc) · 1.73 KB
/
Makefile
File metadata and controls
76 lines (56 loc) · 1.73 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
FIG=docker-compose
RUN=$(FIG) run --rm app
EXEC=$(FIG) exec app
CONSOLE=gosu docker bin/console
.DEFAULT_GOAL := help
.PHONY: help build install start stop boot debug debug-root db db-migrate test
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
##
## Project setup
##---------------------------------------------------------------------------
build: ## Build the Docker image
build:
touch docker/.vault_key
$(FIG) build
install: ## Install vendors
install:
$(RUN) install
start: ## Install the full project (build install db db-migrate up)
start: build install up
stop: ## Stop containers
stop:
$(FIG) kill
$(FIG) rm -v --force
up: ## Run images
up:
docker-compose up -d
##
## Database
##---------------------------------------------------------------------------
db: ## Reset the database
db:
$(RUN) $(CONSOLE) doctrine:database:drop --force --if-exists
$(RUN) $(CONSOLE) doctrine:database:create --if-not-exists
db-migrate: ## Update the database
db-migrate:
$(RUN) $(CONSOLE) doctrine:schema:update --force
db-dump: ## Backup the database
db-dump:
$(FIG) exec mysql bash -c "mysqldump -u root -proot anthonykgrossfr > /var/lib/mysql/backup.sql && chmod 777 /var/lib/mysql/backup.sql"
db-restore: ## Restore the database
db-restore:
$(FIG) exec mysql bash -c "mysql -u root -proot anthonykgrossfr < /var/lib/mysql/backup.sql"
##
## Tests
##---------------------------------------------------------------------------
debug: ## Debug container
debug:
$(EXEC) gosu docker bash
debug-root: ## Debug container as Root user
debug-root:
$(EXEC) bash
test: ## Run tests
test:
$(EXEC) /entrypoint.sh tests
##