forked from shopsys/shopsys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (53 loc) · 2.73 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
generate-schema:
docker-compose exec php-fpm php phing frontend-api-generate-graphql-schema
docker cp shopsys-framework-php-fpm:/var/www/html/project-base/app/schema.graphql /tmp/schema.graphql
docker cp /tmp/schema.graphql shopsys-framework-storefront:/home/node/app/schema.graphql
docker-compose exec -u root storefront chown node:node schema.graphql
docker-compose exec storefront pnpm run gql
docker-compose exec storefront rm -rf /home/node/app/schema.graphql
generate-schema-native:
php phing frontend-api-generate-graphql-schema
cp project-base/app/schema.graphql project-base/storefront/schema.graphql
cd project-base/storefront; pnpm run gql
rm -rf project-base/storefront/schema.graphql
check-schema:
docker-compose exec php-fpm php phing frontend-api-generate-graphql-schema
docker cp shopsys-framework-php-fpm:/var/www/html/project-base/app/schema.graphql /tmp/schema.graphql
docker cp /tmp/schema.graphql shopsys-framework-storefront:/home/node/app/schema.graphql
docker-compose exec -u root storefront chown node:node schema.graphql
docker-compose exec storefront sh check-code-gen.sh
prepare-data-for-acceptance-tests:
docker compose exec php-fpm php phing -D production.confirm.action=y -D change.environment=test environment-change
docker compose exec php-fpm php phing test-db-demo test-elasticsearch-index-recreate test-elasticsearch-export
define run_acceptance_tests
$(call prepare-data-for-acceptance-tests)
docker compose stop storefront
docker compose up -d --wait storefront-cypress
-docker compose run --rm -e TYPE=$(1) -e COMMAND=run cypress;
docker compose stop storefront-cypress
docker compose up -d storefront
docker compose exec php-fpm php phing -D change.environment=dev environment-change
endef
.PHONY: run-acceptance-tests-base
run-acceptance-tests-base:
$(call run_acceptance_tests,base)
.PHONY: run-acceptance-tests-actual
run-acceptance-tests-actual:
$(call run_acceptance_tests,actual)
get_ip = $(shell ifconfig | awk '/^[a-z0-9]+: /{iface=substr($$1, 1, length($$1)-1)} /status: active/{print iface}' | head -1 | xargs -I {} ifconfig {} | awk '/inet /{print $$2; exit}')
define open_acceptance_tests
$(call prepare-data-for-acceptance-tests)
docker compose stop storefront
docker compose up -d --wait storefront-cypress --force-recreate
xhost + $(get_ip);
-docker compose run --rm -e TYPE=$(1) -e DISPLAY=$(get_ip):0 -e COMMAND=open cypress;
docker compose stop storefront-cypress
docker compose up -d storefront
docker compose exec php-fpm php phing -D change.environment=dev environment-change
endef
.PHONY: open-acceptance-tests-base
open-acceptance-tests-base:
$(call open_acceptance_tests,base)
.PHONY: open-acceptance-tests-actual
open-acceptance-tests-actual:
$(call open_acceptance_tests,actual)