Skip to content

Commit

Permalink
Merge branch 'release/v0.8.0'
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
Luphia1984 committed Oct 21, 2024
2 parents e71e182 + f1beb9a commit 3d33871
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "baifa",
"version": "0.1.5+1",
"version": "0.8.0",
"scripts": {
"dev": "next dev",
"build": "npm run generate && next build",
Expand Down
16 changes: 14 additions & 2 deletions shell/auto_redeploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# 定義要檢查的應用程式名稱
APP_NAME="BAIFA"

# 設定工作目錄
cd /workspace/BAIFA/

Expand All @@ -16,8 +19,17 @@ if [ "$LOCAL" != "$REMOTE" ]; then
echo "Running build..."
npm run build
echo "Restarting application..."
pm2 delete BAIFA
pm2 start npm --name BAIFA -- run production
pm2 delete "$APP_NAME"
pm2 start npm --name "$APP_NAME" -- run production
else
echo "No new commits."
fi

# 檢查應用程式是否已啟動
pm2 list | grep "$APP_NAME" | grep -q "online"
if [ $? -eq 0 ]; then
echo "PM2 服務 $APP_NAME 已經在運行中。"
else
echo "PM2 服務 $APP_NAME 沒有運行,正在啟動..."
pm2 start npm --name "$APP_NAME" -- run production
fi

0 comments on commit 3d33871

Please sign in to comment.