hf4all
commited on
Commit
·
4deff3b
1
Parent(s):
4847926
Update start_server.sh
Browse files- start_server.sh +21 -15
start_server.sh
CHANGED
|
@@ -15,21 +15,27 @@ sed -i "s/#COMMIT#/$COMMIT/" nginx.conf
|
|
| 15 |
sed -i "s/#PORT#/$PORT/" nginx.conf
|
| 16 |
|
| 17 |
set +e
|
| 18 |
-
if [[ ! -z "$
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
fi
|
| 34 |
[[ -z $(git config --global user.name) ]] && git config --global user.name "$SPACE_AUTHOR_NAME"
|
| 35 |
[[ -z $(git config --global user.email) ]] && git config --global user.email "$SPACE_AUTHOR_NAME@hf.co"
|
|
|
|
| 15 |
sed -i "s/#PORT#/$PORT/" nginx.conf
|
| 16 |
|
| 17 |
set +e
|
| 18 |
+
if [[ ! -z "$REPOS" ]]; then
|
| 19 |
+
for REPO in $(echo $REPOS | tr ";" "\n")
|
| 20 |
+
do
|
| 21 |
+
dir=$(basename "$REPO" .git)
|
| 22 |
+
echo start to clone initial repo $REPO into $dir
|
| 23 |
+
git clone --progress $REPO $dir
|
| 24 |
+
cd $dir
|
| 25 |
+
[[ -z $(git config user.name) ]] && git config --global user.name "$(git log -1 --pretty=format:'%an')"
|
| 26 |
+
[[ -z $(git config user.email) ]] && git config --global user.email "$(git log -1 --pretty=format:'%ae')"
|
| 27 |
+
if [[ -e requirements.txt ]]; then
|
| 28 |
+
pip install --no-cache-dir --upgrade -r requirements.txt
|
| 29 |
+
fi
|
| 30 |
+
if [[ -e package.json ]]; then
|
| 31 |
+
npm i
|
| 32 |
+
fi
|
| 33 |
+
if [[ -e ecosystem.config.js ]]; then
|
| 34 |
+
echo use pm2 start
|
| 35 |
+
pm2 start ecosystem.config.js
|
| 36 |
+
fi
|
| 37 |
+
cd ..
|
| 38 |
+
done
|
| 39 |
fi
|
| 40 |
[[ -z $(git config --global user.name) ]] && git config --global user.name "$SPACE_AUTHOR_NAME"
|
| 41 |
[[ -z $(git config --global user.email) ]] && git config --global user.email "$SPACE_AUTHOR_NAME@hf.co"
|