deploy changes to test and production environments
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy-to-test (push) Failing after 7m17s
Deploy to Web Server flyer-crawler.projectium.com / deploy-production (push) Has been skipped
Deploy to Test Environment / deploy-to-test (push) Failing after 7m23s

This commit is contained in:
2025-12-10 13:14:34 -08:00
parent 8d12f744bc
commit 37cb1825af
4 changed files with 724 additions and 74 deletions

View File

@@ -6,33 +6,60 @@
module.exports = {
apps: [
{
name: 'flyer-crawler-api', // The name of our API application in PM2
// --- API Server ---
// The name is now dynamically set based on the environment.
// This is a common pattern but requires you to call pm2 with the correct name.
// The deploy script handles this by using 'flyer-crawler-api' for prod and 'flyer-crawler-api-test' for test.
name: 'flyer-crawler-api',
script: './node_modules/.bin/tsx',
args: 'server.ts', // tsx will execute this file
// Explicitly set the working directory. This is crucial for reliability.
cwd: '/var/www/flyer-crawler.projectium.com',
// Production Environment Settings
env_production: {
NODE_ENV: 'production', // Set the Node.js environment to production
name: 'flyer-crawler-api',
cwd: '/var/www/flyer-crawler.projectium.com',
},
// Test Environment Settings
env_test: {
NODE_ENV: 'development', // Use 'development' for test to enable more verbose logging if needed
name: 'flyer-crawler-api-test',
cwd: '/var/www/flyer-crawler-test.projectium.com',
},
},
{
name: 'flyer-crawler-worker', // The name of our worker process in PM2
// --- General Worker ---
name: 'flyer-crawler-worker',
script: './node_modules/.bin/tsx',
args: 'src/services/queueService.server.ts', // tsx will execute this file
// Explicitly set the working directory.
cwd: '/var/www/flyer-crawler.projectium.com',
// Production Environment Settings
env_production: {
NODE_ENV: 'production',
name: 'flyer-crawler-worker',
cwd: '/var/www/flyer-crawler.projectium.com',
},
// Test Environment Settings
env_test: {
NODE_ENV: 'development',
name: 'flyer-crawler-worker-test',
cwd: '/var/www/flyer-crawler-test.projectium.com',
},
},
{
name: 'flyer-crawler-analytics-worker', // A dedicated worker for analytics
// --- Analytics Worker ---
name: 'flyer-crawler-analytics-worker',
script: './node_modules/.bin/tsx',
// Point to the main worker service file. It will start all workers.
args: 'src/services/queueService.server.ts', // tsx will execute this file
cwd: '/var/www/flyer-crawler.projectium.com',
// Production Environment Settings
env_production: {
NODE_ENV: 'production',
name: 'flyer-crawler-analytics-worker',
cwd: '/var/www/flyer-crawler.projectium.com',
},
// Test Environment Settings
env_test: {
NODE_ENV: 'development',
name: 'flyer-crawler-analytics-worker-test',
cwd: '/var/www/flyer-crawler-test.projectium.com',
},
},
],