irongit

should work on first download

huncholanehuncholaneauthored
parent 31125facommit 439cb378a9e68247ecf06304f3ab28f9e79f0c2aBrowse files

6 files changed, +18 -14

+3-3dev
@@ -3,10 +3,10 @@
33
44 # if venv doesn't exist initialize it
55 if [ ! -d "venv" ]; then
6- bash init
7-else
8- source venv/**/activate
6+ bash devscripts/init
97 fi
8+bash devscripts/activate_ready
9+source venv/**/activate
1010
1111 # run devscript for args 1+ if they exist
1212 if [ -n "$1" ]; then
+7-0devscripts/activate_ready
@@ -0,0 +1,7 @@
1+#!/bin/bash
2+
3+# keep checking for activate file to exist
4+while [ ! -f venv/**/activate ]; do
5+ echo "Waiting for venv to be created..."
6+ sleep 1
7+done
+3-0devscripts/back
@@ -4,7 +4,9 @@
44 docker compose down
55 docker compose -f dev-compose.yml up -d --remove-orphans
66
7+python -m pip install --upgrade pip
78 cd rango/backend
9+python -m pip install -r requirements.txt
810
911 # if no .env with ls -a in backend, create one
1012 if [ ! -f .env ]; then
@@ -14,6 +16,7 @@ fi
1416
1517 # if no argument, run the backend
1618 if [ -z "$1" ]; then
19+ python manage.py migrate
1720 python manage.py runserver 0.0.0.0:8000
1821 else
1922 # run the arguments as python manage.py
+1-0devscripts/front
@@ -1,6 +1,7 @@
11 #!/bin/bash
22
33 cd rango/frontend
4+npm install
45
56 # if there is no argument, run the npm dev server
67 # else npm run the command
+1-8devscripts/init
@@ -7,12 +7,5 @@ echo "export DOMAIN=localhost" >> venv/**/activate
77 echo "export POSTGRES_USER=postgres" >> venv/**/activate
88 echo "export POSTGRES_PASSWORD=postgres" >> venv/**/activate
99 echo "export POSTGRES_DB=postgres" >> venv/**/activate
10-echo "export POSTGRES_HOST=postgres" >> venv/**/activate
10+echo "export POSTGRES_HOST=localhost" >> venv/**/activate
1111 echo "export POSTGRES_PORT=5821" >> venv/**/activate
12-
13-source venv/**/activate
14-python -m pip install --upgrade pip
15-cd rango/backend
16-python -m pip install -r requirements.txt
17-cd ../frontend
18-npm install
+3-3rango/backend/entrypoint.sh
@@ -2,9 +2,9 @@
22 # For production only
33
44 # create secret key if .env doesn't exist
5-#if [ ! -f "backend/.env" ]; then
6- #python manage.py createsecret
7-#fi
5+if [ ! -f ".env" ]; then
6+ python manage.py createsecret
7+fi
88
99 # collect staticfiles
1010 python manage.py collectstatic --noinput