mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-20 00:00:13 -06:00
* feat: dashboard container image * fix: build * add release and pre-release * forward cli flags to hatchet-api * fix: make entrypoint executable * hatchet-api path fix * fix: hatchet-api path, again
27 lines
545 B
Bash
27 lines
545 B
Bash
#!/bin/bash
|
|
|
|
# Trap SIGTERM and SIGINT signals to gracefully shut down
|
|
trap 'shutdown' SIGTERM SIGINT
|
|
|
|
# Function to handle shutdown
|
|
shutdown() {
|
|
echo "Gracefully shutting down hatchet-api..."
|
|
kill -SIGTERM "$HATCHET_API_PID"
|
|
|
|
# Wait for hatchet-api to exit
|
|
wait "$HATCHET_API_PID"
|
|
|
|
echo "Shutting down NGINX..."
|
|
nginx -s quit
|
|
|
|
# Exit the script
|
|
exit 0
|
|
}
|
|
|
|
# Start hatchet-api with any passed command line arguments in the background
|
|
./hatchet-api "$@" &
|
|
HATCHET_API_PID=$!
|
|
|
|
# Start NGINX in the foreground
|
|
nginx -g "daemon off;"
|