Przeglądaj źródła

:gear: tweaking post-receive to use pm2

tags/0.0.3^2
j 3 lat temu
rodzic
commit
9f96d9c162
2 zmienionych plików z 5 dodań i 4 usunięć
  1. 1
    0
      backend/server/index.js
  2. 4
    4
      deployment/post-receive

+ 1
- 0
backend/server/index.js Wyświetl plik

13
     if (start) {
13
     if (start) {
14
         await Exiting.createManager(server).start()
14
         await Exiting.createManager(server).start()
15
         server.log(['start'], `Server started at ${server.info.uri}`)
15
         server.log(['start'], `Server started at ${server.info.uri}`)
16
+        process.title = 'SIIMEE_API_PROCESS'
16
         return server
17
         return server
17
     }
18
     }
18
 
19
 

+ 4
- 4
deployment/post-receive Wyświetl plik

1
 #!/bin/bash
1
 #!/bin/bash
2
-
3
 REPO="/opt/staging/siimee.git"
2
 REPO="/opt/staging/siimee.git"
4
 commands=(
3
 commands=(
5
     "cd ${REPO}"
4
     "cd ${REPO}"
8
     "echo no build needed!"
7
     "echo no build needed!"
9
     "cd ${REPO}/frontend && rm -f ${REPO}/frontend/package-lock.json && npm install"
8
     "cd ${REPO}/frontend && rm -f ${REPO}/frontend/package-lock.json && npm install"
10
     "npm run build"
9
     "npm run build"
11
-    "cd ${REPO}/backend && npm run generate && npm run reseed"
10
+    # "cd ${REPO}/backend && npm run generate && npm run reseed"
11
+    "cd ${REPO}/backend && pm2 restart ./server/ i -1 -n siimee_backend"
12
 )
12
 )
13
-
14
 steps=(
13
 steps=(
15
     "navigate to project…"
14
     "navigate to project…"
16
     "git checkout…"
15
     "git checkout…"
18
     "building backend…"
17
     "building backend…"
19
     "frontend npm install…"
18
     "frontend npm install…"
20
     "building frontend…"
19
     "building frontend…"
21
-    "regenerate db data…"
20
+    # "regenerate db data…"
21
+    "start-up…"
22
 )
22
 )
23
 SPAN=92
23
 SPAN=92
24
 COUNT=0
24
 COUNT=0

Ładowanie…
Anuluj
Zapisz