-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathMakefile
79 lines (58 loc) · 2.16 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
watch:
npm run watch
run:
docker ps -a # Docker has to be launched first or the db connection will fail
./manage.py runserver 0.0.0.0:8000
deps:
pip install -r config/requirements/devel.pip --exists-action=w
db:
./manage.py migrate
./manage.py loaddata accounts/fixtures/superadmin.json
clean:
find . -name "*.pyc" -delete
cleanthumbs:
./manage.py thumbnail clear
./manage.py thumbnail cleanup
rm -rf ./media/cache/
test:
DJANGO_TESTS=1 ./manage.py test --no-input --failfast $(test)
migration:
-./manage.py makemigrations
./manage.py migrate
fixtures:
./manage.py dumpdata --indent=2 games > initial_data.json
check-deps-update:
pip3 list --outdated
client:
if [ -e lutris_client/.git ]; then cd lutris_client; git pull; else git clone https://github.com/lutris/lutris lutris_client; fi
docs:
rst2html.py --template=config/rst_template.txt lutris_client/docs/installers.rst > templates/docs/installers.html
shell:
./manage.py shell_plus --traceback
worker:
celery -A lutrisweb worker -B --loglevel=debug --hostname=lutris.net -E
localdb:
# Create a local Postgres database for development
docker volume create lutrisdb_backups
docker run --name lutrisdb -e POSTGRES_PASSWORD=admin -e POSTGRES_DB=lutris -e POSTGRES_USER=lutris -p 5432:5432 -d -v lutrisdb_backups:/backups --shm-size 4gb --restart=unless-stopped postgres:12
localredis:
docker run --name lutriscache -p 6378:6379 -d --restart=unless-stopped redis:latest
syncdb:
# Syncs the production database to the local db
scp anaheim:/home/strider/volumes/lutris-sqldumps/latest.tar.gz latest.tar.gz
gunzip latest.tar.gz
docker cp latest.tar lutrisdb:/backups
docker exec lutrisdb pg_restore -U lutris --clean --dbname=lutris /backups/latest.tar
rm latest.tar
quicksync:
docker cp latest.tar lutrisdb:/backups
docker exec lutrisdb pg_restore -U lutris --clean --dbname=lutris /backups/latest.tar
dbshell:
docker exec -it lutrisdb psql -U lutris lutris
syncmedia:
rsync -avz anaheim:/srv/prod/website/media/ media/
discord:
# Load Discord App IDS to database
./manage.py load_discord_apps discord-app-ids.json
snapshotdb:
docker exec lutrisdb pg_dump --format=tar -U lutris lutris > snapshot.tar