-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
57 lines (47 loc) · 1.3 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
.PHONY: default
default: build reset-db start
# build the docker image
.PHONY: build
build:
docker-compose build
# start the docker image
.PHONY: start
start:
docker-compose up --force-recreate --build -d
# stop the docker image
.PHONY: stop
stop:
docker-compose down
# stop the docker image and remove database information
.PHONY: clean
clean:
docker-compose down -v
# reset the database
.PHONY: reset-db
reset-db:
mkdir -p schema/migrations
docker-compose run web scripts/new_database_unsafe.sh
# attach a shell to the running docker image
.PHONY: shell
shell:
docker exec -it youps_web /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" || echo "\e[33mmake sure you already ran make start\e[0m"
.PHONY: solo-shell
solo-shell:
docker-compose run web /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh"
# get a manage.py shell for running django things
.PHONY: django-shell
django-shell:
docker exec -it youps_web python manage.py shell || from schema.youps import *
# show logs for the running docker containers
.PHONY: logs
logs:
docker-compose logs -f
# old script for updating code on the server after pushing
.PHONY: update-dev
update-dev:
ssh -t [email protected] " \
cd /home/ubuntu/production/mailx; \
git pull; \
sudo lamson restart || sudo lamson start; \
./youps_reboot.sh \
"