Skip to content

Commit

Permalink
split run into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jan 22, 2024
1 parent b83581f commit 9ffb288
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
18 changes: 8 additions & 10 deletions run → run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/bin/bash
set -e

cd "${BASH_SOURCE%/*}"

source ./setup.sh

cd frontend

# TODO: fix dependencies in package.json. Ignore NODE_ENV for now.
yarn install --production=false
printf "\nBuilding front end\n\n"

yarn run build

printf "\nBundling front end\n\n"

if [ "$NODE_ENV" != "production" ]
then
node djangoBundler.js &
Expand All @@ -20,14 +25,7 @@ cd ../backend
export SERVICE_NAME="portal"
export SERVICE_IS_ROOT="1"

pip install pipenv

if [ "$NODE_ENV" != "production" ]
then
pipenv install --dev
else
pipenv install
fi
printf "\nRunning Django server\n\n"

pipenv run python ./manage.py migrate --noinput
pipenv run python ./manage.py collectstatic --noinput --clear
Expand Down
22 changes: 22 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

cd "${BASH_SOURCE%/*}/frontend"

printf "Setting up Node.js environment\n\n"

# TODO: fix dependencies in package.json. Ignore NODE_ENV for now.
yarn install --production=false

cd ../backend

printf "\nSetting up Python environment\n\n"

if [ "$NODE_ENV" != "production" ]
then
pipenv install --dev
else
pipenv install
fi

cd ..

0 comments on commit 9ffb288

Please sign in to comment.