forked from platformsh-templates/akeneo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
125 lines (102 loc) · 2.76 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#
# This file is a template Makefile. Some targets are presented here as examples.
# Feel free to customize it to your needs!
#
CMD_ON_PROJECT = docker-compose run -u www-data --rm php
PHP_RUN = $(CMD_ON_PROJECT) php
YARN_RUN = docker-compose run -u node --rm -e YARN_REGISTRY -e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD node yarn
ifdef NO_DOCKER
CMD_ON_PROJECT =
YARN_RUN = yarnpkg
PHP_RUN = php
endif
.DEFAULT_GOAL := dev
yarn.lock: package.json
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 $(YARN_RUN) install
node_modules: yarn.lock
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 $(YARN_RUN) install
.PHONY: javascript-extensions
javascript-extensions:
$(YARN_RUN) run update-extensions
.PHONY: front-packages
front-packages:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 $(YARN_RUN) packages:build
.PHONY: assets
assets:
$(CMD_ON_PROJECT) rm -rf public/bundles public/js
$(PHP_RUN) bin/console pim:installer:assets --symlink --clean
.PHONY: css
css:
$(CMD_ON_PROJECT) rm -rf public/css
$(YARN_RUN) run less
.PHONY: javascript-prod
javascript-prod:
$(CMD_ON_PROJECT) rm -rf public/dist
$(YARN_RUN) run webpack
.PHONY: javascript-dev
javascript-dev:
$(CMD_ON_PROJECT) rm -rf public/dist
$(YARN_RUN) run webpack-dev
.PHONY: front
front: assets css front-packages javascript-dev
.PHONY: database
database:
$(PHP_RUN) bin/console pim:installer:db ${O}
.PHONY: cache
cache:
$(CMD_ON_PROJECT) rm -rf var/cache && $(PHP_RUN) bin/console cache:warmup
composer.lock: composer.json
$(PHP_RUN) -d memory_limit=4G /usr/local/bin/composer update
vendor: composer.lock
$(PHP_RUN) -d memory_limit=4G /usr/local/bin/composer install
.PHONY: dependencies
dependencies: vendor node_modules
.PHONY: dev
dev:
$(MAKE) dependencies
$(MAKE) pim-dev
.PHONY: prod
prod:
$(MAKE) dependencies
$(MAKE) pim-prod
.PHONY: pim-prod
pim-prod:
ifndef NO_DOCKER
APP_ENV=prod $(MAKE) up
docker/wait_docker_up.sh
endif
$(MAKE) cache
$(MAKE) assets
$(MAKE) front-packages
$(MAKE) javascript-prod
$(MAKE) css
$(MAKE) javascript-extensions
APP_ENV=prod $(MAKE) database O="--catalog vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle/Resources/fixtures/minimal"
.PHONY: pim-dev
pim-dev:
ifndef NO_DOCKER
APP_ENV=dev $(MAKE) up
docker/wait_docker_up.sh
endif
$(MAKE) cache
$(MAKE) assets
$(MAKE) front-packages
$(MAKE) javascript-dev
$(MAKE) css
$(MAKE) javascript-extensions
APP_ENV=dev $(MAKE) database O="--catalog vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle/Resources/fixtures/icecat_demo_dev"
.PHONY: up
up:
docker-compose up -d --remove-orphans
.PHONY: down
down:
docker-compose down -v
.PHONY: upgrade-front
upgrade-front:
$(MAKE) node_modules
$(MAKE) cache
$(MAKE) assets
$(MAKE) front-packages
$(MAKE) javascript-prod
$(MAKE) css
$(MAKE) javascript-extensions