-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (46 loc) · 2.08 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
#!/bin/bash
DOCKER_BE = akonforms-be
OS := $(shell uname)
ifeq ($(OS),Darwin)
UID = $(shell id -u)
else ifeq ($(OS),Linux)
UID = $(shell id -u)
else
UID = 1000
endif
help: ## Show this help message
@echo 'usage: make [target]'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
run: ## Start the containers
docker network create akonforms-network || true
U_ID=${UID} docker-compose up -d
stop: ## Stop the containers
U_ID=${UID} docker-compose stop
restart: ## Restart the containers
$(MAKE) stop && $(MAKE) run
build: ## Rebuilds all the containers
U_ID=${UID} docker-compose build
prepare: ## Runs backend commands
$(MAKE) composer-install
# Backend commands
composer-install: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} -it ${DOCKER_BE} composer install --no-scripts --no-interaction --optimize-autoloader
yarn-install: ## Installs yarn dependencies
U_ID=${UID} docker exec --user ${UID} -it ${DOCKER_BE} yarn install
yarn-encore: ## Encore yarn dev
U_ID=${UID} docker exec --user ${UID} -it ${DOCKER_BE} yarn encore dev
migrations: ## Runs the migrations
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} bin/console doctrine:migrations:migrate -n
be-logs: ## Tails the Symfony dev log
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} tail -f var/log/dev.log
# End backend commands
ssh-be: ## ssh's into the be container
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} bash
code-style: ## Runs php-cs to fix code styling following Symfony rules
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} php-cs-fixer fix src --rules=@Symfony
generate-ssh-keys: ## Generar los sshk keys de JWT library
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} mkdir -p config/jwt
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} openssl genrsa -passout pass:21023c10e2208b4d3a4a279ea0bf5ee6 -out config/jwt/private.pem -aes256 4096
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} openssl rsa -pubout -passin pass:21023c10e2208b4d3a4a279ea0bf5ee6 -in config/jwt/private.pem -out config/jwt/public.pem