forked from OpenSlides/OpenSlides
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (69 loc) · 2.83 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
DC_PATH=dev/docker
SCRIPT_PATH=dev/scripts
DC=docker compose -f $(DC_PATH)/docker-compose.dev.yml
# Main command: start the dev server
run-dev: | build-dev
$(DC) up $(ARGS)
# Same as run-dev, but with OpenTelemetry
run-dev-otel: | build-dev
$(DC) -f $(DC_PATH)/dc.otel.dev.yml up $(ARGS)
# Build the docker dev images for all services in parallel
build-dev:
$(SCRIPT_PATH)/submodules-do.sh 'make build-dev'
# Run the tests of all services
run-service-tests:
git submodule foreach 'make run-tests'
# Execute while run-dev is running: Switch to the test database to execute backend tests without
# interfering with your dev database
switch-to-test:
$(DC) stop postgres
docker compose -f $(DC_PATH)/docker-compose.test.yml up -d postgres-test
$(DC) -f $(DC_PATH)/docker-compose.backend.yml up -d backend
$(DC) restart datastore-writer datastore-reader autoupdate vote
# Execute while run-dev is running: Switch back to your dev database
switch-to-dev:
docker compose -f $(DC_PATH)/docker-compose.test.yml stop postgres-test
$(DC) up -d postgres backend
$(DC) restart datastore-writer datastore-reader autoupdate vote
# Shorthand to directly enter a shell in the backend after switching the databases
run-backend: | switch-to-test
$(DC) exec backend ./entrypoint.sh bash --rcfile .bashrc
# Stop all backend-related services so that the backend dev setup can start
stop-backend:
$(DC) stop backend datastore-reader datastore-writer auth vote postgres redis icc autoupdate search
# Restart all backend-related services
start-backend:
$(DC) up -d backend datastore-reader datastore-writer auth vote postgres redis icc autoupdate search
# Stop the dev server
stop-dev:
$(DC) down --volumes --remove-orphans
# Stop the dev server with OpenTelemetry
stop-dev-otel:
$(DC) -f $(DC_PATH)/dc.otel.dev.yml down --volumes --remove-orphans
build:
$(DC_PATH)/build.sh
# Shorthands to execute the make-release script
services-to-main:
$(SCRIPT_PATH)/make-update.sh fetch-all-changes $(ARGS)
services-to-main-pull:
$(SCRIPT_PATH)/make-update.sh fetch-all-changes --pull $(ARGS)
staging-update:
$(SCRIPT_PATH)/make-update.sh staging $(ARGS)
hotfix-update:
$(SCRIPT_PATH)/make-update.sh hotfix $(ARGS)
stable-update:
$(SCRIPT_PATH)/make-update.sh stable $(ARGS)
# You may only use this one time after cloning this repository.
# Will set the upstream remote to "origin"
submodules-origin-to-upstream:
git submodule foreach -q --recursive 'git remote rename origin upstream'
# Translation helper targets
extract-translations:
dev/scripts/extract-translations.sh
push-translations:
tx push --source
pull-translations:
tx pull --translations --languages $$(dev/scripts/dc-dev.sh exec client npm run get-available-languages | tail -n 1)
copy-translations:
cp i18n/*.po openslides-client/client/src/assets/i18n/
cp i18n/*.po openslides-backend/openslides_backend/i18n/messages/