-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·63 lines (48 loc) · 2.44 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
DIR ?= App
ENV ?= dev
SERVICE ?= app-$(ENV)
IMAGE ?= symfony-app-$(ENV)
COMMAND ?= debug:container
.DEFAULT_GOAL := start
THIS_FILE := $(lastword $(MAKEFILE_LIST))
ENV_COMPOSER = dev
ENV_YARN = ""
ifeq ($(ENV),prod)
ENV_COMPOSER = no-dev
ENV_YARN = :prod
endif
#COMPOSER COMMANDS
composer-install:
docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "composer install -d=/app/$(DIR) --$(ENV_COMPOSER)"
composer-update:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "composer update -d=/app/$(DIR) --$(ENV_COMPOSER)"
#SYMFONY COMMANDS
create-database:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "php /app/$(DIR)/etc/bin/symfony-console doctrine:database:create --if-not-exists"
migrations:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "php /app/$(DIR)/etc/bin/symfony-console do:mi:mi -v --no-interaction --allow-no-migration"
cache-clear:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "php /app/$(DIR)/etc/bin/symfony-console cache:clear -e $(ENV)"
symfony-console:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "php /app/$(DIR)/etc/bin/symfony-console $(COMMAND)"
yarn-install-and-build:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec app-$(ENV) bash -c "cd /app/CompositeUi/src/Infrastructure/Ui/Assets && yarn install && yarn build$(YARN_COMPOSER)"
#DOCKER COMMANDS
docker-compose-exec:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec $(SERVICE) bash -c "$(COMMAND)"
stop:
@docker-compose -f Docker/docker-compose.$(ENV).yaml down
start:
@docker-compose -f Docker/docker-compose.$(ENV).yaml down && \
docker-compose -f Docker/docker-compose.$(ENV).yaml up -d
build:
@rsync --ignore-existing Docker/.env.dist Docker/.env && \
chmod -R 777 App/var CompositeUi/var && \
docker-compose -f Docker/docker-compose.$(ENV).yaml down && \
docker-compose -f Docker/docker-compose.$(ENV).yaml build --pull --no-cache && \
docker-compose -f Docker/docker-compose.$(ENV).yaml up -d
composer-install-all:
@docker-compose -f Docker/docker-compose.$(ENV).yaml exec app-$(ENV) bash -c "composer install -d=/app/App --$(ENV_COMPOSER)" && \
docker-compose -f Docker/docker-compose.$(ENV).yaml exec app-$(ENV) bash -c "composer install -d=/app/CompositeUi --$(ENV_COMPOSER)"
docker-connect:
@docker exec -t -i $(IMAGE) /bin/bash