-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (69 loc) · 2.48 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
#!make
backend: backend-build | backend-run
database: database-build | database-run
frontend: frontend-build | frontend-run
project: project-build | project-run
rebuild: project-build
reset: stop | clean
database-seed: database-dump | database-dump-seed
database-seed-local: database-dump | database-dump-seed-local
project-build:
@echo "+\n++ Performing project build ...\n+"
@docker-compose build --force-rm --no-cache
project-run:
@echo "+\n++ Running project...\n+"
@docker-compose up -d
backend-build:
@echo "+\n++ Performing backend build ...\n+"
@docker-compose build --force-rm --no-cache backend
backend-run:
@echo "+\n++ Running backend app...\n+"
@docker-compose up -d backend
backend-entry:
@echo "+\n++ Entering backend container ...\n+"
@docker exec -it mds_backend bash
database-build:
@echo "+\n++ Performing postgres build ...\n+"
@docker-compose build postgres
database-run:
@echo "+\n++ Running postgres and Flyway migrations...\n+"
@docker-compose up -d postgres flyway
frontend-build:
@echo "+\n++ Performing frontend build ...\n+"
@docker-compose build frontend
frontend-run:
@echo "+\n++ Running frontend...\n+"
@docker-compose up -d frontend
database-dump:
@echo "+\n++ Getting database dump from test environment...\n+"
@sh ./openshift/scripts/database-dump.sh empr-mds-test pgDump-test
database-dump-seed:
@echo "+\n++ Seeding docker database...\n+"
@docker cp pgDump-test.pgCustom mds_postgres:/tmp/
@docker exec -it mds_postgres pg_restore -U mds -d mds -c /tmp/pgDump-test.pgCustom
database-dump-seed-local:
@echo "+\n++ Seeding locally installed database...\n+"
@pg_restore -U mds -d mds -c pgDump-test.pgCustom
database-dump-clean:
@echo "+\n++ Removing dump file...\n+"
@rm -f pgDump-test.pgCustom
keycloak:
@echo "+\n++ Running keycloak...\n+"
@docker-compose up --force-recreate -d keycloak
keycloak-user:
@echo "+\n++ Creating local admin user...\n+"
@docker exec -it mds_keycloak /tmp/keycloak-local-user.sh
test:
@echo "+\n++ Running functional test...\n+"
@cd functional-tests && ./gradlew chromeTest -DchromeTest.single=CustomJUnitSpecRunner
test-headless:
@echo "+\n++ Running functional test...\n+"
@cd functional-tests && ./gradlew chromeHeadlessTest -DchromeHeadlessTest.single=CustomJUnitSpecRunner
stop:
@echo "+\n++ Stopping backend and postgres...\n+"
@docker-compose down
clean:
@echo "+\n++ Cleaning ...\n+"
@docker-compose rm -f -v -s
@docker rmi -f mds_postgres mds_backend mds_frontend
@docker volume rm mds_postgres-data -f