hf4all commited on
Commit
4deff3b
1 Parent(s): 4847926

Update start_server.sh

Browse files
Files changed (1) hide show
  1. 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 "$REPO" ]]; then
19
- dir=$(basename "$REPO" .git)
20
- echo start to clone initial repo $REPO into $dir
21
- git clone --progress $REPO $dir
22
- cd $dir
23
- [[ -z $(git config user.name) ]] && git config --global user.name "$(git log -1 --pretty=format:'%an')"
24
- [[ -z $(git config user.email) ]] && git config --global user.email "$(git log -1 --pretty=format:'%ae')"
25
- if [[ -e requirements.txt ]]; then
26
- pip install --no-cache-dir --upgrade -r requirements.txt
27
- fi
28
- if [[ -e ecosystem.config.js ]]; then
29
- echo use pm2 start
30
- pm2 start ecosystem.config.js
31
- fi
32
- cd ..
 
 
 
 
 
 
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 "[email protected]"
 
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 "[email protected]"