generated from Lab-Lab-Lab/cpr-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
55 lines (53 loc) · 2.14 KB
/
setup.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
#!/bin/bash
git remote add upstream https://github.com/Lab-Lab-Lab/cpr-dev.git
echo "setup.sh 01" >> /var/log/cpr-dev.log
git clone https://github.com/Lab-Lab-Lab/CPR-Music-Backend-hcientist.git CPR-Music-Backend
echo "setup.sh 02" >> /var/log/cpr-dev.log
git clone https://github.com/Lab-Lab-Lab/CPR-Music-hcientist.git CPR-Music
echo "setup.sh 03" >> /var/log/cpr-dev.log
cd CPR-Music-Backend
echo "setup.sh 04" >> /var/log/cpr-dev.log
cp .env.local .env
echo "setup.sh 05" >> /var/log/cpr-dev.log
if [ "$CODESPACES" = "true" ]; then
echo "setup.sh 05.1" >> /var/log/cpr-dev.log
echo "CORS_ALLOWED_ORIGIN_REGEXES=^http://localhost:3000$,^https://$CODESPACE_NAME-3000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN$" >> .env
else
echo "setup.sh 05.2" >> /var/log/cpr-dev.log
echo "CORS_ALLOWED_ORIGIN_REGEXES=^http://localhost:3000$" >> .env
fi
echo "setup.sh 06" >> /var/log/cpr-dev.log
pip install -r requirements/local.txt --no-input
echo "setup.sh 07" >> /var/log/cpr-dev.log
python manage.py migrate
echo "setup.sh 08" >> /var/log/cpr-dev.log
python manage.py createsuperuser --no-input
echo "setup.sh 09" >> /var/log/cpr-dev.log
# python manage.py runserver & #put in postAttach instead
echo "setup.sh 10" >> /var/log/cpr-dev.log
cd ..
echo "setup.sh 11" >> /var/log/cpr-dev.log
cd CPR-Music
echo "setup.sh 12" >> /var/log/cpr-dev.log
npm ci
echo "setup.sh 13" >> /var/log/cpr-dev.log
if [ "$CODESPACES" = "true" ]; then
echo "setup.sh 13.1" >> /var/log/cpr-dev.log
echo "NEXT_PUBLIC_BACKEND_HOST=\"https://$CODESPACE_NAME-8000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN\"
NEXTAUTH_URL=\"https://$CODESPACE_NAME-3000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN\"
" > .env.local
else
echo "setup.sh 13.2" >> /var/log/cpr-dev.log
fi
echo "setup.sh 16" >> /var/log/cpr-dev.log
# npm run dev & #put in postAttach instead
echo "setup.sh 17" >> /var/log/cpr-dev.log
cd ..
echo "setup.sh 18" >> /var/log/cpr-dev.log
if [ "$CODESPACES" = "true" ]; then
echo "setup.sh 19" >> /var/log/cpr-dev.log
gh codespace ports -c $CODESPACE_NAME visibility 3000:public 8000:public
echo "setup.sh 20" >> /var/log/cpr-dev.log
else
echo "setup.sh 19" >> /var/log/cpr-dev.log
fi