✨ Add support for local deployment target in Pokedex deployment scripts
This commit is contained in:
@@ -41,6 +41,9 @@ const SSH_HOSTS = {
|
|||||||
port: 2323,
|
port: 2323,
|
||||||
username: 'GregRJacobs',
|
username: 'GregRJacobs',
|
||||||
privateKeyPath: '~/.ssh/ds3627xs_gregrjacobs'
|
privateKeyPath: '~/.ssh/ds3627xs_gregrjacobs'
|
||||||
|
},
|
||||||
|
local: {
|
||||||
|
host: 'localhost'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ function parseArgs() {
|
|||||||
// Validate target
|
// Validate target
|
||||||
if (!SSH_HOSTS[config.target]) {
|
if (!SSH_HOSTS[config.target]) {
|
||||||
throw new Error(
|
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 {
|
try {
|
||||||
// Parse arguments
|
// Parse arguments
|
||||||
const config = parseArgs();
|
const config = parseArgs();
|
||||||
|
const isLocal = config.target === 'local';
|
||||||
const sshConfig = SSH_HOSTS[config.target];
|
const sshConfig = SSH_HOSTS[config.target];
|
||||||
|
|
||||||
console.log('🚀 Starting Pokedex.Online deployment');
|
console.log('🚀 Starting Pokedex.Online deployment');
|
||||||
|
if (isLocal) {
|
||||||
|
console.log(`📡 Target: local`);
|
||||||
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`📡 Target: ${config.target} (${sshConfig.host}:${sshConfig.port})`
|
`📡 Target: ${config.target} (${sshConfig.host}:${sshConfig.port})`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
console.log(`🔌 Frontend Port: ${config.port}`);
|
console.log(`🔌 Frontend Port: ${config.port}`);
|
||||||
if (config.sslPort) {
|
if (config.sslPort) {
|
||||||
console.log(`🔒 HTTPS Port: ${config.sslPort}`);
|
console.log(`🔒 HTTPS Port: ${config.sslPort}`);
|
||||||
@@ -220,7 +228,9 @@ async function deploy() {
|
|||||||
console.log(`🔌 Backend Port: ${config.backendPort}`);
|
console.log(`🔌 Backend Port: ${config.backendPort}`);
|
||||||
|
|
||||||
// Connect to Synology using ~/.ssh/config
|
// Connect to Synology using ~/.ssh/config
|
||||||
|
if (!isLocal) {
|
||||||
console.log('\n🔐 Connecting to Synology...');
|
console.log('\n🔐 Connecting to Synology...');
|
||||||
|
|
||||||
const keyPath = expandTilde(sshConfig.privateKeyPath);
|
const keyPath = expandTilde(sshConfig.privateKeyPath);
|
||||||
console.log(` 🔑 Using SSH key: ${keyPath}`);
|
console.log(` 🔑 Using SSH key: ${keyPath}`);
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
# ./deploy.sh [options]
|
# ./deploy.sh [options]
|
||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# --target <internal|external> Deployment target (default: internal)
|
# --target <internal|external|local> Deployment target (default: internal)
|
||||||
# --port <number> Frontend HTTP port (default: 8080)
|
# --port <number> Frontend HTTP port (default: 8080)
|
||||||
# --ssl-port <number> Frontend HTTPS port (optional)
|
# --ssl-port <number> Frontend HTTPS port (optional)
|
||||||
# --backend-port <number> Backend port (default: 3000)
|
# --backend-port <number> Backend port (default: 3000)
|
||||||
@@ -373,7 +373,11 @@ print_summary() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo -e " ${YELLOW}Next Steps:${NC}"
|
echo -e " ${YELLOW}Next Steps:${NC}"
|
||||||
echo -e " • Test the application manually"
|
echo -e " • Test the application manually"
|
||||||
|
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"
|
echo -e " • Check logs: npm run docker:logs"
|
||||||
|
fi
|
||||||
echo -e " • Monitor backend: curl http://$HOST:$BACKEND_PORT/health"
|
echo -e " • Monitor backend: curl http://$HOST:$BACKEND_PORT/health"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user