🚀 Add local deployment support and improve error handling in deploy script

This commit is contained in:
2026-01-30 04:58:27 +00:00
parent 66a6db193b
commit e472db461d

View File

@@ -282,6 +282,7 @@ async function deploy() {
); );
throw new Error(`SSH connection failed: ${connError.message}`); throw new Error(`SSH connection failed: ${connError.message}`);
} }
}
// Build Vue 3 application // Build Vue 3 application
console.log('\n🔨 Building Vue 3 application...'); console.log('\n🔨 Building Vue 3 application...');
@@ -316,6 +317,11 @@ async function deploy() {
throw new Error(`Build failed: ${error.message}`); throw new Error(`Build failed: ${error.message}`);
} }
if (isLocal) {
await deployLocal(config);
return;
}
// Check if container exists and capture current image // Check if container exists and capture current image
console.log('\n📦 Checking for existing container...'); console.log('\n📦 Checking for existing container...');
console.log(` Container name: ${CONTAINER_NAME}`); console.log(` Container name: ${CONTAINER_NAME}`);
@@ -565,6 +571,10 @@ async function deploy() {
ssh.dispose(); ssh.dispose();
} catch (error) { } catch (error) {
if (config && config.target === 'local') {
console.error('\n❌ Deployment failed:', error.message);
process.exit(1);
}
console.error('\n❌ Deployment failed:', error.message); console.error('\n❌ Deployment failed:', error.message);
// Rollback // Rollback