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