BlueGit

timfa filemanager

Files

filemanager / start.sh

start.sh

service requirements
timfa Tim Falken · pushed by timfa · 6 months ago
7f110dab History
start.sh 532 B Download Raw
1#!/usr/bin/env bash
2# start.sh — used as the systemd service ExecStart.
3# Pulls latest code, installs dependencies, then replaces this shell with
4# the Node process so systemd tracks the correct PID and restart works.
5
6set -euo pipefail
7
8SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9cd "$SCRIPT_DIR"
10
11echo "[start.sh] git reset --hard"
12git reset --hard
13
14echo "[start.sh] git pull"
15git pull
16
17echo "[start.sh] npm install --omit=dev"
18npm install --omit=dev
19
20echo "[start.sh] starting server"
21exec node server/index.js