Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 30, 2024
1 parent 824773c commit 8fcb884
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions labapp/labapp_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ mkdir -p "$APPDIR" "$SCRIPTDIR"
cat <<EOF >"$SCRIPTDIR/start_app.sh"
#!/bin/bash
# Ensure the directory exists and pull or clone repo
if [ ! -d "\$APPDIR/.git" ]; then
git clone --branch $BRANCH $REPO_URL "$APPDIR"
# Navigate to the app directory
cd "$APPDIR"
# Check if the directory is a git repository and if not, clone it
if [ ! -d ".git" ]; then
git clone --branch $BRANCH $REPO_URL .
else
cd "$APPDIR"
# Reset repository to match the remote repository
git remote set-url origin $REPO_URL
git fetch --prune
git checkout $BRANCH
Expand All @@ -42,7 +45,7 @@ fi
pip3 install -r requirements.txt
# Start the Gunicorn server
gunicorn --workers 4 --bind 0.0.0.0:1337 app:app
export UDF="true" && gunicorn --workers 4 --chdir labapp/app --bind 0.0.0.0:1337 app:app
EOF

chmod +x "$SCRIPTDIR/start_app.sh"
Expand Down

0 comments on commit 8fcb884

Please sign in to comment.