-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
78 lines (67 loc) · 2.34 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
include .env
# ecl: build ECL from dev branch indicated in .env file.
.PHONY: ecl-dev
ecl-dev: .env build-ecl copy-dist copy-twig compile-sass
# Files to make
.env:
cp .env.dist .env
## build-ecl: build ECL.
.PHONY: build-ecl
build-ecl:
[ ! -d ecl-build ] || rm -rf ecl-build
git clone -b $(ECL_BUILD_REF) $(ECL_BUILD_REPO) --depth 1 ecl-build
yarn --cwd ./ecl-build install
# Add ECL dependencies that cannot be required by ECL.
# @see https://github.com/ec-europa/europa-component-library#warning-momentjs
yarn --cwd ./ecl-build add [email protected] -W
yarn --cwd ./ecl-build add [email protected] -W
yarn --cwd ./ecl-build add [email protected] -W
yarn --cwd ./ecl-build dist:presets
## compile-sass: compile SASS.
.PHONY: compile-sass
compile-sass:
[ ! -d ./ecl-build/oe_theme_sass ] || rm -rf ./ecl-build/oe_theme_sass
[ ! -d ./ecl-build/oe_theme_css ] || rm -rf ./ecl-build/oe_theme_css
cp -r sass ./ecl-build/oe_theme_sass
yarn --cwd ./ecl-build sass -I node_modules/ --style=expanded oe_theme_sass:oe_theme_css
[ ! -d ./css ] || rm -rf ./css
mv ./ecl-build/oe_theme_css css
# SASS duplicates the "oe_theme_css" inside the target directory.
# @todo fix this.
[ ! -d ./css/oe_theme_css ] || rm -rf ./css/oe_theme_css
## copy-ecl-dist: build ECL.
.PHONY: copy-dist
copy-dist:
[ ! -d dist ] || rm -rf dist
mkdir dist
mkdir dist/js
cp -r ./ecl-build/dist/packages/ec dist/ec
cp -r ./ecl-build/dist/packages/eu dist/eu
cp ./ecl-build/node_modules/moment/min/moment.min.js ./dist/js
cp ./ecl-build/node_modules/pikaday/pikaday.js ./dist/js
cp ./ecl-build/node_modules/svg4everybody/dist/svg4everybody.js ./dist/js
## copy-twig : copy ECL twigs in the destination directory.
.PHONY: copy-twig
copy-twig:
bash ./scripts/copy-twig-templates.sh
## site: Build and install site.
.PHONY: site
site: build-site install-site
## build-site: build site.
.PHONY: build-site
build-site:
rm -rf build
rm -rf vendor
rm -f composer.lock
composer install
## install-site: install site.
.PHONY: install-site
install-site:
./vendor/bin/run drupal:site-setup
./vendor/bin/run drupal:site-install
.PHONY: shell-node
shell-node:
docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='oe_theme-$(or $(filter-out $@,$(MAKECMDGOALS)), 'node')' --format "{{ .ID }}") bash
# https://stackoverflow.com/a/6273809/1826109
%:
@: