-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
94 lines (72 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
.PHONY: \
vendors \
data_dirs \
init
.DEFAULT: vendors
CURRENT_UID=$(shell id -u)
CURRENT_GID=$(shell id -g)
init: config
docker-compose run --rm cli /bin/bash -l -c "make vendors"
docker-compose run --rm cli /bin/bash -l -c "./symfony propel:build-all --no-confirmation"
docker-compose run --rm cli /bin/bash -l -c "./symfony madb:insert-test-data"
docker-compose run --rm cli /bin/bash -l -c "./symfony cache:clear"
# vendors
vendors: vendor
composer.phar:
$(eval EXPECTED_SIGNATURE = "$(shell wget -q -O - https://composer.github.io/installer.sig)")
$(eval ACTUAL_SIGNATURE = "$(shell php -r "copy('https://getcomposer.org/installer', 'composer-setup.php'); echo hash_file('SHA384', 'composer-setup.php');")")
@if [ "$(EXPECTED_SIGNATURE)" != "$(ACTUAL_SIGNATURE)" ]; then echo "Invalid signature"; exit 1; fi
php composer-setup.php
rm composer-setup.php
vendor: composer.phar
php composer.phar install
# docker
docker-up: log/docker-build data_dirs
docker-compose up
docker-up--detached: log/docker-build data_dirs
docker-compose up -d
docker-down:
docker-compose down
docker-build: log/docker-build
log/docker-build: data_dirs docker-compose.yml docker-compose.override.yml $(shell find docker/dockerfiles -type f)
docker-compose rm --force
CURRENT_UID=$(CURRENT_UID) CURRENT_GID=$(CURRENT_GID) docker-compose build
touch .docker-build
data_dirs: docker/data docker/data/composer
docker/data:
mkdir -p docker/data
docker/data/composer: docker/data
mkdir -p docker/data/composer
docker-compose.override.yml:
cp docker-compose.override.yml-dist docker-compose.override.yml
config: config/databases.yml config/propel.ini config/madbconf.yml
config/databases.yml:
cp config/databases.yml-dist config/databases.yml
sed --in-place 's/%%host%%/dbapp/' config/databases.yml
sed --in-place 's/%%database%%/madb/' config/databases.yml
sed --in-place 's/%%user%%/madbuser/' config/databases.yml
sed --in-place 's/%%pass%%/madbpass/' config/databases.yml
config/propel.ini:
cp config/propel.ini-dist config/propel.ini
sed --in-place 's/%%host%%/dbapp/' config/propel.ini
sed --in-place 's/%%database%%/madb/' config/propel.ini
sed --in-place 's/%%user%%/madbuser/' config/propel.ini
sed --in-place 's/%%pass%%/madbpass/' config/propel.ini
config/madbconf.yml:
cp config/madbconf.yml-dist config/madbconf.yml
.PHONY: test-functional
test-functional:
make docker-up--detached
make init
make test-functional--run
make docker-down
.PHONY: test-functional--run
test-functional--run:
docker-compose build cypress
docker-compose run cypress
.PHONY: test-functional--open
test-functional--open:
docker-compose build cypress
#on donne l'accès à x11 depuis le container
xhost local:root
docker-compose run --entrypoint=cypress -e DISPLAY=unix$(DISPLAY) cypress open --project ./