update deploy scripts

This commit is contained in:
Emily
2025-01-30 14:33:31 +01:00
parent a2e4ed9ee0
commit 0f39cab26a
3 changed files with 6 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ export class DeployHelper {
const argvMode = process.argv[2]
if (argvMode != '--production' && argvMode != '--testmode') {
console.error('use --production or --testmode');
process.exit(1);
process.exit(0);
}
const MODE = argvMode === '--production' ? 'production' : 'testmode';
return MODE;

View File

@@ -26,7 +26,8 @@ async function main() {
if (MODE === 'testmode') {
const ecosystemContent = fs.readFileSync(LOCAL_PATH + '/ecosystem.config.js', 'utf8');
const devContent = ecosystemContent.replace("redis://litlyx.com", `redis://${REMOTE_HOST_TESTMODE}`);
const REDIS_URL = ecosystemContent.match(/REDIS_URL: ["'](.*?)["']/)[1];
const devContent = ecosystemContent.replace(REDIS_URL, `redis://${REMOTE_HOST_TESTMODE}`);
archive.append(Buffer.from(devContent), { name: '/ecosystem.config.js' });
} else {
archive.file(LOCAL_PATH + '/ecosystem.config.js', { name: '/ecosystem.config.js' })