should work on first download
6 files changed, +18 -14
+3-3dev
| @@ -3,10 +3,10 @@ | ||
| 3 | 3 | |
| 4 | 4 | # if venv doesn't exist initialize it |
| 5 | 5 | if [ ! -d "venv" ]; then |
| 6 | - bash init | |
| 7 | -else | |
| 8 | - source venv/**/activate | |
| 6 | + bash devscripts/init | |
| 9 | 7 | fi |
| 8 | +bash devscripts/activate_ready | |
| 9 | +source venv/**/activate | |
| 10 | 10 | |
| 11 | 11 | # run devscript for args 1+ if they exist |
| 12 | 12 | 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 @@ | ||
| 4 | 4 | docker compose down |
| 5 | 5 | docker compose -f dev-compose.yml up -d --remove-orphans |
| 6 | 6 | |
| 7 | +python -m pip install --upgrade pip | |
| 7 | 8 | cd rango/backend |
| 9 | +python -m pip install -r requirements.txt | |
| 8 | 10 | |
| 9 | 11 | # if no .env with ls -a in backend, create one |
| 10 | 12 | if [ ! -f .env ]; then |
| @@ -14,6 +16,7 @@ fi | ||
| 14 | 16 | |
| 15 | 17 | # if no argument, run the backend |
| 16 | 18 | if [ -z "$1" ]; then |
| 19 | + python manage.py migrate | |
| 17 | 20 | python manage.py runserver 0.0.0.0:8000 |
| 18 | 21 | else |
| 19 | 22 | # run the arguments as python manage.py |
+1-0devscripts/front
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | #!/bin/bash |
| 2 | 2 | |
| 3 | 3 | cd rango/frontend |
| 4 | +npm install | |
| 4 | 5 | |
| 5 | 6 | # if there is no argument, run the npm dev server |
| 6 | 7 | # else npm run the command |
+1-8devscripts/init
| @@ -7,12 +7,5 @@ echo "export DOMAIN=localhost" >> venv/**/activate | ||
| 7 | 7 | echo "export POSTGRES_USER=postgres" >> venv/**/activate |
| 8 | 8 | echo "export POSTGRES_PASSWORD=postgres" >> venv/**/activate |
| 9 | 9 | echo "export POSTGRES_DB=postgres" >> venv/**/activate |
| 10 | -echo "export POSTGRES_HOST=postgres" >> venv/**/activate | |
| 10 | +echo "export POSTGRES_HOST=localhost" >> venv/**/activate | |
| 11 | 11 | 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 @@ | ||
| 2 | 2 | # For production only |
| 3 | 3 | |
| 4 | 4 | # 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 | |
| 8 | 8 | |
| 9 | 9 | # collect staticfiles |
| 10 | 10 | python manage.py collectstatic --noinput |