File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,14 @@ mkdir -p "$APPDIR" "$SCRIPTDIR"
26
26
cat << EOF >"$SCRIPTDIR /start_app.sh"
27
27
#!/bin/bash
28
28
29
- # Ensure the directory exists and pull or clone repo
30
- if [ ! -d "\$ APPDIR/.git" ]; then
31
- git clone --branch $BRANCH $REPO_URL "$APPDIR "
29
+ # Navigate to the app directory
30
+ cd "$APPDIR "
31
+
32
+ # Check if the directory is a git repository and if not, clone it
33
+ if [ ! -d ".git" ]; then
34
+ git clone --branch $BRANCH $REPO_URL .
32
35
else
33
- cd " $APPDIR "
36
+ # Reset repository to match the remote repository
34
37
git remote set-url origin $REPO_URL
35
38
git fetch --prune
36
39
git checkout $BRANCH
39
42
fi
40
43
41
44
# Install required Python packages
42
- pip3 install -r requirements.txt
45
+ pip3 install -r labapp/app/ requirements.txt
43
46
44
47
# Start the Gunicorn server
45
- gunicorn --workers 4 --bind 0.0.0.0:1337 app:app
48
+ export UDF="true" && gunicorn --workers 4 --chdir labapp/app --bind 0.0.0.0:1337 app:app
46
49
EOF
47
50
48
51
chmod +x " $SCRIPTDIR /start_app.sh"
66
69
# Reload systemd to recognize new service, enable it
67
70
systemctl daemon-reload
68
71
systemctl enable mcn-practical-labapp.service
69
- systemctl start mcn-practical-labapp.service
70
72
71
73
echo " mcn-practical-labapp.service has been installed."
You can’t perform that action at this time.
0 commit comments