-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy.sh
100 lines (74 loc) · 2.27 KB
/
deploy.sh
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
#!/bin/sh
# sudo git pull origin master
# sudo pip3 install -r requirements.txt
echo "hello!"
cd $(dirname "$0")
echo "현재경로"
pwd //현재경로
echo "change user to root"
sudo su
echo "chmod velogapp"
chmod +x ./velog/velogapp
echo "chmod authentication"
chmod +x ./velog/authentication
echo "chmod deploy.sh"
chmod +x ./deploy.sh
echo "chmod templates"
chmod +x ./velog/templates/
chmod +x ./velog/templates/account/
chmod +x ./velog/templates/account
chmod +x ./velog/templates/socialaccount/
chmod +x ./velog/templates/socialaccount
# chmod +x ./velog/templates/loaders/
# chmod +x ./velog/templates/loaders
# chmod +x ./velog/templates/account/messages/
# chmod +x ./velog/templates/account/messages/logged_in.txt
chmod 777 ./velog/templates/
chmod 777 ./velog/templates/account/
chmod 777 ./velog/templates/account
chmod 777 ./velog/templates/socialaccount/
chmod 777 ./velog/templates/socialaccount
# chmod 777 ./velog/templates/loaders/
# chmod 777 ./velog/templates/loaders
# chmod 777 ./velog/templates/account/messages/
# chmod 777 ./velog/templates/account/messages/logged_in.txt
echo "installing python..."
sudo apt update
sudo apt-get install python3.8
echo "installing pip..."
sudo apt-get install python3-pip
echo "installing virtualenv"
sudo pip3 install virtualenv
echo "installing gunicorn"
sudo python3 -m pip install gunicorn
echo "installing environ"
sudo python3 -m pip install django-environ
echo "activate venv..."
. /home/ubuntu/team7elog/bin/activate
echo "install package..."
cd velog
sudo python3 -m pip install -r "requirements.txt"
echo "install django..."
python3 -m pip install django==4.1
echo "install pymysql..."
python3 -m pip install pymysql
echo "installing drf_yasg..."
sudo python3 -m pip install drf_yasg
echo "installing coresheaders..."
sudo python3 -m pip install django-cors-headers
echo "collect static..."
yes | python3 manage.py collectstatic
# echo "make migrations..."
# yes | python3 manage.py makemigrations
# echo "apply migration..."
# python3 manage.py migrate
#echo "move location to project..."
#cd velog
echo "gunicorn..."
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
sudo systemctl status gunicorn
echo "nginx..."
sudo systemctl restart nginx
sudo systemctl status nginx
# sudo systemctl restart gunicorn