- scripts/deploy.sh with no tag deploys the latest main (detached origin/main); with a tag, that release. - ecosystem.config.js is no longer in git (now ecosystem.config.example.js; the deploy creates the install's copy from it once). The deploy keeps the install's copy safe across checkouts and rollbacks, including releases that still tracked it. - The script runs from a temp copy, so checking out a new deploy.sh can't change it mid-run; set -E so failures in functions still roll back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
706 B
JavaScript
23 lines
706 B
JavaScript
// PM2 config template. Each install keeps its own copy as ecosystem.config.js (not in git,
|
|
// so deploys never change it); scripts/deploy.sh creates it from this file the first time.
|
|
// Change the app names (unique per install on a server) and the frontend port to suit.
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'hope-events-backend',
|
|
cwd: __dirname + '/backend',
|
|
script: 'src/index.js',
|
|
env: { NODE_ENV: 'production' },
|
|
max_memory_restart: '500M',
|
|
},
|
|
{
|
|
name: 'hope-events-frontend',
|
|
cwd: __dirname + '/frontend',
|
|
script: 'npm',
|
|
args: 'start -- -p 3000',
|
|
env: { NODE_ENV: 'production' },
|
|
max_memory_restart: '500M',
|
|
},
|
|
],
|
|
};
|