diff --git a/code/utils/deploy-pokedex.js b/code/utils/deploy-pokedex.js index 0d0cb4b..006f306 100644 --- a/code/utils/deploy-pokedex.js +++ b/code/utils/deploy-pokedex.js @@ -41,6 +41,9 @@ const SSH_HOSTS = { port: 2323, username: 'GregRJacobs', privateKeyPath: '~/.ssh/ds3627xs_gregrjacobs' + }, + local: { + host: 'localhost' } }; @@ -81,7 +84,7 @@ function parseArgs() { // Validate target if (!SSH_HOSTS[config.target]) { throw new Error( - `Invalid target: ${config.target}. Must be 'internal' or 'external'.` + `Invalid target: ${config.target}. Must be 'internal', 'external', or 'local'.` ); } @@ -207,12 +210,17 @@ async function deploy() { try { // Parse arguments const config = parseArgs(); + const isLocal = config.target === 'local'; const sshConfig = SSH_HOSTS[config.target]; console.log('šŸš€ Starting Pokedex.Online deployment'); - console.log( - `šŸ“” Target: ${config.target} (${sshConfig.host}:${sshConfig.port})` - ); + if (isLocal) { + console.log(`šŸ“” Target: local`); + } else { + console.log( + `šŸ“” Target: ${config.target} (${sshConfig.host}:${sshConfig.port})` + ); + } console.log(`šŸ”Œ Frontend Port: ${config.port}`); if (config.sslPort) { console.log(`šŸ”’ HTTPS Port: ${config.sslPort}`); @@ -220,7 +228,9 @@ async function deploy() { console.log(`šŸ”Œ Backend Port: ${config.backendPort}`); // Connect to Synology using ~/.ssh/config - console.log('\nšŸ” Connecting to Synology...'); + if (!isLocal) { + console.log('\nšŸ” Connecting to Synology...'); + const keyPath = expandTilde(sshConfig.privateKeyPath); console.log(` šŸ”‘ Using SSH key: ${keyPath}`); console.log( diff --git a/code/websites/pokedex.online/deploy.sh b/code/websites/pokedex.online/deploy.sh index 927d7d5..a23a064 100755 --- a/code/websites/pokedex.online/deploy.sh +++ b/code/websites/pokedex.online/deploy.sh @@ -10,10 +10,10 @@ # ./deploy.sh [options] # # Options: -# --target Deployment target (default: internal) -# --port Frontend HTTP port (default: 8080) -# --ssl-port Frontend HTTPS port (optional) -# --backend-port Backend port (default: 3000) +# --target Deployment target (default: internal) +# --port Frontend HTTP port (default: 8080) +# --ssl-port Frontend HTTPS port (optional) +# --backend-port Backend port (default: 3000) # --skip-tests Skip test execution # --skip-build Skip build step (use existing dist/) # --no-backup Skip backup creation @@ -373,7 +373,11 @@ print_summary() { echo "" echo -e " ${YELLOW}Next Steps:${NC}" echo -e " • Test the application manually" - echo -e " • Check logs: npm run docker:logs" + if [ "$TARGET" = "local" ]; then + echo -e " • Check logs: docker compose -f docker-compose.tmp.yml logs -f" + else + echo -e " • Check logs: npm run docker:logs" + fi echo -e " • Monitor backend: curl http://$HOST:$BACKEND_PORT/health" echo "" echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"