-
-
Notifications
You must be signed in to change notification settings - Fork 277
/
Makefile
55 lines (41 loc) · 1.29 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
DOCKER_VERSION := $(shell docker --version 2>/dev/null)
DOCKER_COMPOSE_VERSION := $(shell docker-compose --version 2>/dev/null)
all:
ifndef DOCKER_VERSION
$(error "command docker is not available, please install Docker")
endif
ifndef DOCKER_COMPOSE_VERSION
$(error "command docker-compose is not available, please install Docker")
endif
build:
docker-compose build --no-cache backend frontend
up:
docker network inspect tm-web >/dev/null 2>&1 || \
docker network create tm-web
docker-compose up -d
down:
docker-compose down
list:
docker-compose ps
refresh-frontend:
docker-compose exec frontend sh -c "cd frontend && npm run build"
refresh-translatables:
docker-compose exec frontend sh -c "cd frontend && yarn build-locales"
refresh-translations:
docker-compose exec frontend sh -c "tx pull -af"
tests:test-frontend test-backend
test-frontend:
docker-compose exec frontend sh -c "cd /usr/src/app/frontend && CI=true npm test"
test-backend:
docker-compose exec backend sh -c "python -m unittest discover tests/backend"
fetch:
ifndef PRNUMBER
$(error "Define PRNUMBER variable")
else
git fetch origin pull/$(PRNUMBER)/head:pr$(PRNUMBER)
git checkout pr$(PRNUMBER)
endif
checkout:down fetch build up tests down
# Run doxygen to make API documentation
apidocs:
-@cd docs && doxygen