Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…actical into dev
  • Loading branch information
kreynoldsf5 committed Apr 30, 2024
2 parents 34f4ecd + c016968 commit c10090b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 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 @@ -39,10 +42,10 @@ else
fi
# Install required Python packages
pip3 install -r requirements.txt
pip3 install -r labapp/app/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 All @@ -66,6 +69,5 @@ EOF
# Reload systemd to recognize new service, enable it
systemctl daemon-reload
systemctl enable mcn-practical-labapp.service
systemctl start mcn-practical-labapp.service

echo "mcn-practical-labapp.service has been installed."

0 comments on commit c10090b

Please sign in to comment.