fix: resolve retired/preview gemini model routing and test configuration errors
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the service name/path for easy updates
|
||||
set -e
|
||||
|
||||
BINARY_NAME="gophergate"
|
||||
SOURCE_PATH="./cmd/gophergate/main.go"
|
||||
|
||||
echo "Stopping existing $BINARY_NAME processes..."
|
||||
# Using pkill; || true ensures the script continues even if no process was found
|
||||
pkill -9 "$BINARY_NAME" || echo "No running process found."
|
||||
|
||||
echo "Pulling latest changes from git..."
|
||||
git stash || true
|
||||
git pull
|
||||
|
||||
echo "Building the application..."
|
||||
if go build -o "$BINARY_NAME" "$SOURCE_PATH"; then
|
||||
echo "Build successful. Starting $BINARY_NAME in the background..."
|
||||
# Launch with nohup and redirect output to a log file
|
||||
nohup "./$BINARY_NAME" > gophergate.log 2>&1 &
|
||||
echo "Service started. PID: $!"
|
||||
go build -o "$BINARY_NAME" "$SOURCE_PATH"
|
||||
|
||||
echo "Restarting service..."
|
||||
systemctl restart gophergate
|
||||
|
||||
sleep 2
|
||||
if systemctl is-active --quiet gophergate; then
|
||||
echo "Deploy complete. Service is running."
|
||||
systemctl status gophergate --no-pager | head -5
|
||||
else
|
||||
echo "Build failed! Keeping the previous state."
|
||||
echo "Service failed to start! Check: journalctl -u gophergate -n 20"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user