✨ Add support for local deployment target in Pokedex deployment scripts
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
# ./deploy.sh [options]
|
||||
#
|
||||
# Options:
|
||||
# --target <internal|external> Deployment target (default: internal)
|
||||
# --port <number> Frontend HTTP port (default: 8080)
|
||||
# --ssl-port <number> Frontend HTTPS port (optional)
|
||||
# --backend-port <number> Backend port (default: 3000)
|
||||
# --target <internal|external|local> Deployment target (default: internal)
|
||||
# --port <number> Frontend HTTP port (default: 8080)
|
||||
# --ssl-port <number> Frontend HTTPS port (optional)
|
||||
# --backend-port <number> 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}"
|
||||
|
||||
Reference in New Issue
Block a user