From 9f8c7ed741373f651a856abd0640cabcc3df4b93 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Thu, 29 Jan 2026 06:37:29 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Enhance=20deployment=20script=20wit?= =?UTF-8?q?h=20separate=20health=20checks=20for=20frontend=20and=20backend?= =?UTF-8?q?=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/utils/deploy-pokedex.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/code/utils/deploy-pokedex.js b/code/utils/deploy-pokedex.js index 9aa8162..532be1c 100644 --- a/code/utils/deploy-pokedex.js +++ b/code/utils/deploy-pokedex.js @@ -493,20 +493,29 @@ async function deploy() { console.log('\nāœ… Container started'); - // Health check - console.log('\nšŸ„ Performing health check...'); - const isHealthy = await healthCheck(sshConfig.host, config.port); - - if (!isHealthy) { - throw new Error('Health check failed - container is not responding'); + // Health checks + console.log('\nšŸ„ Performing health checks...'); + console.log(' Checking frontend...'); + const frontendHealthy = await healthCheck(sshConfig.host, config.port); + if (!frontendHealthy) { + throw new Error('Frontend health check failed - container is not responding'); } + console.log(' āœ… Frontend healthy'); - console.log('āœ… Health check passed'); + console.log(' Checking backend...'); + const backendHealthy = await healthCheck(sshConfig.host, config.backendPort); + if (!backendHealthy) { + throw new Error('Backend health check failed - container is not responding'); + } + console.log(' āœ… Backend healthy'); + + console.log('\nāœ… All health checks passed'); console.log(`\nšŸŽ‰ Deployment successful!`); - console.log(`🌐 HTTP: http://${sshConfig.host}:${config.port}`); + console.log(`🌐 Frontend: http://${sshConfig.host}:${config.port}`); if (config.sslPort) { - console.log(`šŸ”’ HTTPS: https://${sshConfig.host}:${config.sslPort}`); + console.log(`šŸ”’ HTTPS: https://${sshConfig.host}:${config.sslPort}`); } + console.log(`šŸ”Œ Backend: http://${sshConfig.host}:${config.backendPort}`); ssh.dispose(); } catch (error) {