File: entrypoint.sh

package info (click to toggle)
python-trame 3.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 101,620 kB
  • sloc: python: 13,515; sh: 183; javascript: 93; makefile: 7
file content (23 lines) | stat: -rwxr-xr-x 687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

# The entrypoint provides some branching logic as to what we
# are going to do. By default, it runs the server.
# If the first argument is "build", however, it will build the
# server instead, and forward any extra args to the build script.

# First, perform initial setup
. /opt/trame/setup.sh

if [[ "$1" == "build" ]]; then
  # Run the build
  # Forward all arguments after `build`, so the user can pass things
  # like `www venv launcher` etc.
  echo "Running build..."
  gosu trame-user /opt/trame/build.sh ${@:2}
  echo "Build complete"
else
  # Start the server
  /opt/trame/runtime_patch.sh
  echo "Starting server..."
  gosu trame-user /opt/trame/run.sh
fi