Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf2cc5b832 | ||
| d2db3562bb | |||
|
|
0532b4b22e | ||
|
|
e767ccbb21 | ||
| 1ff813f495 | |||
| 204fe4394a |
@@ -121,6 +121,11 @@ jobs:
|
||||
run: |
|
||||
echo "Deploying application files to /var/www/flyer-crawler.projectium.com..."
|
||||
APP_PATH="/var/www/flyer-crawler.projectium.com"
|
||||
|
||||
# CRITICAL: Stop PM2 processes BEFORE deploying files to prevent CWD errors
|
||||
echo "--- Stopping production PM2 processes before file deployment ---"
|
||||
pm2 stop flyer-crawler-api flyer-crawler-worker flyer-crawler-analytics-worker || echo "No production processes to stop"
|
||||
|
||||
mkdir -p "$APP_PATH"
|
||||
mkdir -p "$APP_PATH/flyer-images/icons" "$APP_PATH/flyer-images/archive"
|
||||
rsync -avz --delete --exclude 'node_modules' --exclude '.git' --exclude 'dist' --exclude 'flyer-images' ./ "$APP_PATH/"
|
||||
|
||||
@@ -506,6 +506,10 @@ jobs:
|
||||
echo "Deploying application files to /var/www/flyer-crawler-test.projectium.com..."
|
||||
APP_PATH="/var/www/flyer-crawler-test.projectium.com"
|
||||
|
||||
# CRITICAL: Stop PM2 processes BEFORE deploying files to prevent CWD errors
|
||||
echo "--- Stopping test PM2 processes before file deployment ---"
|
||||
pm2 stop flyer-crawler-api-test flyer-crawler-worker-test flyer-crawler-analytics-worker-test || echo "No test processes to stop"
|
||||
|
||||
# Ensure the destination directory exists
|
||||
mkdir -p "$APP_PATH"
|
||||
mkdir -p "$APP_PATH/flyer-images/icons" "$APP_PATH/flyer-images/archive" # Ensure all required subdirectories exist
|
||||
|
||||
86
.gitea/workflows/restart-pm2.yml
Normal file
86
.gitea/workflows/restart-pm2.yml
Normal file
@@ -0,0 +1,86 @@
|
||||
# .gitea/workflows/restart-pm2.yml
|
||||
#
|
||||
# Manual workflow to restart PM2 processes and verify their status.
|
||||
# Useful for recovering from PM2 daemon crashes or process issues.
|
||||
name: Restart PM2 Processes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
description: 'Environment to restart (test, production, or both)'
|
||||
required: true
|
||||
default: 'test'
|
||||
type: choice
|
||||
options:
|
||||
- test
|
||||
- production
|
||||
- both
|
||||
|
||||
jobs:
|
||||
restart-pm2:
|
||||
runs-on: projectium.com
|
||||
|
||||
steps:
|
||||
- name: Validate Environment Input
|
||||
run: |
|
||||
echo "Restarting PM2 processes for environment: ${{ gitea.event.inputs.environment }}"
|
||||
|
||||
- name: Restart Test Environment
|
||||
if: gitea.event.inputs.environment == 'test' || gitea.event.inputs.environment == 'both'
|
||||
run: |
|
||||
echo "=== RESTARTING TEST ENVIRONMENT ==="
|
||||
cd /var/www/flyer-crawler-test.projectium.com
|
||||
|
||||
echo "--- Current PM2 State (Before Restart) ---"
|
||||
pm2 list
|
||||
|
||||
echo "--- Restarting Test Processes ---"
|
||||
pm2 restart flyer-crawler-api-test flyer-crawler-worker-test flyer-crawler-analytics-worker-test || {
|
||||
echo "Restart failed, attempting to start processes..."
|
||||
pm2 start ecosystem-test.config.cjs
|
||||
}
|
||||
|
||||
echo "--- Saving PM2 Process List ---"
|
||||
pm2 save
|
||||
|
||||
echo "--- Waiting 3 seconds for processes to stabilize ---"
|
||||
sleep 3
|
||||
|
||||
echo "=== TEST ENVIRONMENT STATUS ==="
|
||||
pm2 ps
|
||||
|
||||
- name: Restart Production Environment
|
||||
if: gitea.event.inputs.environment == 'production' || gitea.event.inputs.environment == 'both'
|
||||
run: |
|
||||
echo "=== RESTARTING PRODUCTION ENVIRONMENT ==="
|
||||
cd /var/www/flyer-crawler.projectium.com
|
||||
|
||||
echo "--- Current PM2 State (Before Restart) ---"
|
||||
pm2 list
|
||||
|
||||
echo "--- Restarting Production Processes ---"
|
||||
pm2 restart flyer-crawler-api flyer-crawler-worker flyer-crawler-analytics-worker || {
|
||||
echo "Restart failed, attempting to start processes..."
|
||||
pm2 start ecosystem.config.cjs
|
||||
}
|
||||
|
||||
echo "--- Saving PM2 Process List ---"
|
||||
pm2 save
|
||||
|
||||
echo "--- Waiting 3 seconds for processes to stabilize ---"
|
||||
sleep 3
|
||||
|
||||
echo "=== PRODUCTION ENVIRONMENT STATUS ==="
|
||||
pm2 ps
|
||||
|
||||
- name: Final PM2 Status (All Processes)
|
||||
run: |
|
||||
echo "========================================="
|
||||
echo "FINAL PM2 STATUS - ALL PROCESSES"
|
||||
echo "========================================="
|
||||
pm2 ps
|
||||
|
||||
echo ""
|
||||
echo "--- PM2 Logs (Last 20 Lines) ---"
|
||||
pm2 logs --lines 20 --nostream || echo "No logs available"
|
||||
@@ -139,3 +139,5 @@ See [INSTALL.md](INSTALL.md) for the complete list.
|
||||
## License
|
||||
|
||||
[Add license information here]
|
||||
|
||||
annoyed
|
||||
|
||||
@@ -56,7 +56,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -90,7 +90,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -114,7 +114,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -138,7 +138,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -161,7 +161,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -189,7 +189,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -211,7 +211,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -234,7 +234,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -259,7 +259,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -284,7 +284,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -307,7 +307,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -330,7 +330,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -355,7 +355,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -379,7 +379,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -425,7 +425,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -448,7 +448,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -476,7 +476,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -502,7 +502,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -529,7 +529,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -555,7 +555,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -579,7 +579,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -612,7 +612,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -637,7 +637,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -656,7 +656,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -681,7 +681,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -705,7 +705,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -757,7 +757,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Measurements**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Measurements**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -775,7 +775,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -791,7 +791,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -807,7 +807,7 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
**Pass/Fail**: [ ]
|
||||
|
||||
**Notes**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Notes**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
|
||||
---
|
||||
|
||||
@@ -849,8 +849,8 @@ podman exec -it flyer-crawler-dev npm run dev:container
|
||||
|
||||
## Sign-Off
|
||||
|
||||
**Tester Name**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Date Completed**: ****\*\*****\*\*****\*\*****\_\_\_****\*\*****\*\*****\*\*****
|
||||
**Tester Name**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
**Date Completed**: \***\*\*\*\*\***\*\*\***\*\*\*\*\***\_\_\_\***\*\*\*\*\***\*\*\***\*\*\*\*\***
|
||||
**Overall Status**: [ ] PASS [ ] PASS WITH ISSUES [ ] FAIL
|
||||
|
||||
**Ready for Production**: [ ] YES [ ] NO [ ] WITH FIXES
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "flyer-crawler",
|
||||
"version": "0.16.0",
|
||||
"version": "0.16.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "flyer-crawler",
|
||||
"version": "0.16.0",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@bull-board/api": "^6.14.2",
|
||||
"@bull-board/express": "^6.14.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "flyer-crawler",
|
||||
"private": true,
|
||||
"version": "0.16.0",
|
||||
"version": "0.16.2",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
||||
Reference in New Issue
Block a user