chore(release): merge dev to main for v1.8.6
This commit is contained in:
commit
d2ece3b15f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"name": "my-weekly-todo-list",
|
||||||
"version": "1.8.5",
|
"version": "1.8.6",
|
||||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -16,35 +16,42 @@ log "=== Boot update started ==="
|
|||||||
|
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
|
|
||||||
|
# Check and ensure we are on main branch
|
||||||
|
log "Ensuring main branch..."
|
||||||
|
git checkout main 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
# Check if there are remote changes
|
# Check if there are remote changes
|
||||||
log "Fetching from origin..."
|
log "Fetching from origin..."
|
||||||
git fetch origin main 2>&1 | tee -a "$LOG_FILE"
|
git fetch origin main 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
LOCAL=$(git rev-parse HEAD)
|
LOCAL=$(git rev-parse HEAD)
|
||||||
REMOTE=$(git rev-parse origin/main)
|
REMOTE=$(git rev-parse origin/main)
|
||||||
|
NEXT_DIR="$APP_DIR/.next"
|
||||||
|
|
||||||
if [ "$LOCAL" = "$REMOTE" ]; then
|
if [ "$LOCAL" = "$REMOTE" ] && [ -d "$NEXT_DIR" ]; then
|
||||||
log "Already up-to-date. No rebuild needed."
|
log "Already up-to-date and .next directory exists. No rebuild needed."
|
||||||
log "=== Boot update finished (no changes) ==="
|
log "=== Boot update finished (no changes) ==="
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Changes detected. Updating from $LOCAL to $REMOTE"
|
if [ "$LOCAL" != "$REMOTE" ]; then
|
||||||
|
log "Changes detected. Updating from $LOCAL to "$REMOTE""
|
||||||
log "Pulling latest changes..."
|
log "Pulling latest changes..."
|
||||||
git checkout main 2>&1 | tee -a "$LOG_FILE"
|
|
||||||
git pull origin main 2>&1 | tee -a "$LOG_FILE"
|
git pull origin main 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
log "Installing dependencies..."
|
log "Installing dependencies..."
|
||||||
npm install 2>&1 | tee -a "$LOG_FILE"
|
npm install 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
log "Updating database schema..."
|
if [ ! -d "$NEXT_DIR" ] || [ "$LOCAL" != "$REMOTE" ]; then
|
||||||
npx prisma db push 2>&1 | tee -a "$LOG_FILE"
|
log "Updating database schema (Safe Migrate)..."
|
||||||
|
npx prisma migrate deploy 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
log "Regenerating Prisma client..."
|
log "Regenerating Prisma client..."
|
||||||
npx prisma generate 2>&1 | tee -a "$LOG_FILE"
|
npx prisma generate 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
log "Building application..."
|
log "Building application..."
|
||||||
npm run build 2>&1 | tee -a "$LOG_FILE"
|
npm run build 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
log "=== Boot update finished (rebuilt successfully) ==="
|
log "=== Boot update finished (verified/rebuilt) ==="
|
||||||
|
|||||||
@ -14,8 +14,8 @@ git pull origin main
|
|||||||
echo -e "${YELLOW}Step 2: Installing dependencies...${NC}"
|
echo -e "${YELLOW}Step 2: Installing dependencies...${NC}"
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
echo -e "${YELLOW}Step 3: Updating database schema...${NC}"
|
echo -e "${YELLOW}Step 3: Updating database schema (Safe Migrate)...${NC}"
|
||||||
npx prisma db push
|
npx prisma migrate deploy
|
||||||
|
|
||||||
echo -e "${YELLOW}Step 4: Regenerating Prisma client...${NC}"
|
echo -e "${YELLOW}Step 4: Regenerating Prisma client...${NC}"
|
||||||
npx prisma generate
|
npx prisma generate
|
||||||
@ -23,8 +23,10 @@ npx prisma generate
|
|||||||
echo -e "${YELLOW}Step 5: Building application...${NC}"
|
echo -e "${YELLOW}Step 5: Building application...${NC}"
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
echo -e "${YELLOW}Step 6: Restarting server with PM2...${NC}"
|
echo -e "${YELLOW}Step 6: Restarting server with PM2 (Standalone Mode)...${NC}"
|
||||||
pm2 restart my-weekly-todo || pm2 start npm --name "my-weekly-todo" -- start
|
# Delete old process if it exists to ensure fresh config
|
||||||
|
pm2 delete my-weekly-todo || true
|
||||||
|
pm2 start .next/standalone/server.js --name "my-weekly-todo"
|
||||||
pm2 save
|
pm2 save
|
||||||
|
|
||||||
echo -e "${GREEN}Update complete! App is running on LXC.${NC}"
|
echo -e "${GREEN}Update complete! App is running on LXC.${NC}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user