-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
150 lines (123 loc) · 6.17 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
include .env.cypress
export $(shell sed 's/=.*//' .env.cypress)
reset-cache-resource-only:
- docker-compose ${COMPOSE_FILE} kill cache resource cache-warmup forever-cache
- docker-compose ${COMPOSE_FILE} up -d cache resource forever-cache
- sleep 10
- docker-compose ${COMPOSE_FILE} up -d cache-warmup
- sleep 5
reset-cache:
- docker-compose ${COMPOSE_FILE} kill yggdrasil triplestore file cache resource migrations cache-warmup publication-report decision-report-generation vlaams-parlement-sync minutes-report-generation
- rm -rf ${PROJECT_PATH}/testdata/db && rm -rf ${PROJECT_PATH}/testdata/files
- unzip -o ${PROJECT_PATH}/testdata.zip -d ${PROJECT_PATH}
- docker-compose ${COMPOSE_FILE} up -d triplestore database migrations cache forever-cache
- sleep 20
- docker-compose ${COMPOSE_FILE} up -d
- sleep 5
reset-elastic-and-cache:
- docker-compose ${COMPOSE_FILE} kill yggdrasil triplestore elasticsearch search file file-bundling docx-conversion forever-cache cache resource migrations cache-warmup publication-report decision-report-generation vlaams-parlement-sync minutes-report-generation
- docker-compose ${COMPOSE_FILE} rm -f yggdrasil triplestore elasticsearch search file file-bundling docx-conversion forever-cache cache resource migrations cache-warmup publication-report decision-report-generation vlaams-parlement-sync minutes-report-generation
- rm -rf ${PROJECT_PATH}/testdata
- rm -rf ${PROJECT_PATH}/testdata-elasticsearch
- unzip -o ${PROJECT_PATH}/testdata.zip -d ${PROJECT_PATH}
- unzip -o ${PROJECT_PATH}/testdata-elasticsearch.zip -d ${PROJECT_PATH}
- mv ${PROJECT_PATH}/testdata-elasticsearch/* ${PROJECT_PATH}/testdata
- rm -rf ${PROJECT_PATH}/testdata-elasticsearch
- docker-compose ${COMPOSE_FILE} up -d triplestore database migrations cache forever-cache
- sleep 20
- docker-compose ${COMPOSE_FILE} up -d
- sleep 120
run-cypress-tests:
- make reset-elastic-and-cache
- npx cypress run
run-cypress-tests-headless:
- make reset-elastic-and-cache
- npx cypress run --headless
run-cypress-spec-files:
- make reset-elastic-and-cache
- npx cypress run --spec ${SPECS}
run-cypress-spec-files-no-reset:
- npx cypress run --spec ${SPECS}
open-cypress-tests:
- make reset-elastic-and-cache
- ./node_modules/.bin/cypress open
open-npx-cypress-tests:
- make reset-elastic-and-cache
- npx cypress open
me-a-sandwich:
@echo making you a choco sandwich
lint-html:
- ./node_modules/.bin/ember-template-lint .
drc-up-d:
- docker-compose ${COMPOSE_FILE} up -d triplestore migrations database cache forever-cache
- sleep 20
- docker-compose ${COMPOSE_FILE} up -d
drc-kill:
- docker-compose ${COMPOSE_FILE} kill && docker-compose ${COMPOSE_FILE} rm -f
drc-up-d-service:
- docker-compose ${COMPOSE_FILE} up -d ${SERV}
drc-kill-service:
- docker-compose ${COMPOSE_FILE} kill ${SERV}
drc-kill-and-up-service:
- make drc-kill-service
- make drc-up-d-service
drc-restart-service:
- docker-compose ${COMPOSE_FILE} restart ${SERV}
drc:
- docker-compose ${COMPOSE_FILE} ${args}
new-zip-run-migrations:
# start with a clean DB (no tests run yet / reset before test)
# optional, make a backup of current zips (or discard changes if final zips are wrong)
- make drc-kill
- rm -rf ${PROJECT_PATH}/testdata
- rm -rf ${PROJECT_PATH}/testdata-elasticsearch
- unzip -o ${PROJECT_PATH}/testdata.zip -d ${PROJECT_PATH}
- unzip -o ${PROJECT_PATH}/testdata-elasticsearch.zip -d ${PROJECT_PATH}
- mv ${PROJECT_PATH}/testdata-elasticsearch/* ${PROJECT_PATH}/testdata
- rm -rf ${PROJECT_PATH}/testdata-elasticsearch
- docker-compose ${COMPOSE_FILE} up -d triplestore migrations && docker-compose ${COMPOSE_FILE} logs -f migrations
# instead of backup up the zips you could rename the current ones after this step
# wait till migrations are done
new-zip-run-up-triplestore:
- docker-compose ${COMPOSE_FILE} up -d triplestore migrations && docker-compose ${COMPOSE_FILE} logs -f migrations
new-zip-run-yggdrasil:
# make sure the yggdrasil env flags are enabled => USE_DIRECT_QUERIES: "yes" / RELOAD_ON_INIT: "true"
# manually remove all 3 graphs via sparql
# DROP SILENT GRAPH <http://mu.semte.ch/graphs/organizations/intern-regering>
# DROP SILENT GRAPH <http://mu.semte.ch/graphs/organizations/intern-overheid>
# DROP SILENT GRAPH <http://mu.semte.ch/graphs/organizations/minister>
- docker-compose ${COMPOSE_FILE} up -d database
- docker-compose ${COMPOSE_FILE} up -d yggdrasil && docker-compose ${COMPOSE_FILE} logs -f yggdrasil
# wait for yggdrasil to complete, remove the flags and docker-compose kill yggdrasil.
new-zip-run-reindex:
# run ./scripts/reset-elastic-test.sh in the project folder
- docker-compose ${COMPOSE_FILE} logs -f search
# wait for search reindex to complete
# testdata folder should now contain new index and new database.
# put the elasticsearch folder in a folder named "testdata-elasticsearch" and zip it
# keep the other folders in the testdata folder and zip the "testdata" folder.
# these 2 should be the new zips
# run make reset-elastic-and-cache and verify
# testdata.zip contains folder named "testdata" with subfolders "db", "files", "tika"
# testdata-elasticsearch.zip contains folder named "testdata-elasticsearch" with subfolder "elasticsearch"
new-database-move-dump:
# first, make a dump with the old version
# drc exec -T triplestore isql-v
# SQL> dump_nquads ('dumps', 1, 1000000000, 1);
# make sure the file has the right permissions (not locked)
# - mkdir ${PROJECT_PATH}/testdata/db/toLoad
- mv ${PROJECT_PATH}/testdata/db/dumps/* ${PROJECT_PATH}/testdata/db/toLoad
- rm ${PROJECT_PATH}/testdata/db/virtuoso.db
- rm ${PROJECT_PATH}/testdata/db/virtuoso.pxa
- rm ${PROJECT_PATH}/testdata/db/virtuoso-temp.db
- rm ${PROJECT_PATH}/testdata/db/.data_loaded
- rm ${PROJECT_PATH}/testdata/db/.dba_pwd_set
- rm ${PROJECT_PATH}/testdata/db/*.trx
# new-database-version:
# drc down the stack
# switch database to new version
# - docker-compose ${COMPOSE_FILE} up -d triplestore && docker-compose ${COMPOSE_FILE} logs -f triplestore
# new-database-migrations:
# - docker-compose ${COMPOSE_FILE} up -d migrations && docker-compose ${COMPOSE_FILE} logs -f migrations
# new-database-database:
# - docker-compose ${COMPOSE_FILE} up -d database && docker-compose ${COMPOSE_FILE} logs -f database