From c4c3a57bf7763b6e95721061d40263c252d80b40 Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 31 Jul 2024 15:54:54 +0100 Subject: [PATCH] Update pr-deploy.sh Signed-off-by: Dominic --- pr-deploy.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pr-deploy.sh b/pr-deploy.sh index c74204b0..c8613678 100644 --- a/pr-deploy.sh +++ b/pr-deploy.sh @@ -84,18 +84,18 @@ sudo docker run -d -p $FREE_PORT:$EXPOSED_PORT --name $PR_ID $PR_ID echo "Start SSH session..." # Checks if serveo -check_serveo() { - grep -q "ssh: connect to host serveo.net port 22: Connection refused" serveo_output.log || grep -q "ssh: connect to host serveo.net port 22: Connection timed out" serveo_output.log -} - -# Set up tunneling using Serveo with a random high-numbered port -nohup ssh -tt -o StrictHostKeyChecking=no -R 80:localhost:$FREE_PORT serveo.net > serveo_output.log 2>&1 & -sleep 3 - -# Check if Serveo tunnel was set up successfully -if [ check_serveo ]; then - DEPLOYED_URL=$(grep "Forwarding HTTP traffic from" serveo_output.log | tail -n 1 | awk '{print $5}') -else +# check_serveo() { +# grep -q "ssh: connect to host serveo.net port 22: Connection refused" serveo_output.log || grep -q "ssh: connect to host serveo.net port 22: Connection timed out" serveo_output.log +# } + +# # Set up tunneling using Serveo with a random high-numbered port +# nohup ssh -tt -o StrictHostKeyChecking=no -R 80:localhost:$FREE_PORT serveo.net > serveo_output.log 2>&1 & +# sleep 3 + +# # Check if Serveo tunnel was set up successfully +# if [ check_serveo ]; then +# DEPLOYED_URL=$(grep "Forwarding HTTP traffic from" serveo_output.log | tail -n 1 | awk '{print $5}') +# else nohup ssh -tt -o StrictHostKeyChecking=no -R 80:localhost:$FREE_PORT ssh.localhost.run > localhost_run_output.log 2>&1 & sleep 3 if grep -q "Connect to" localhost_run_output.log; then @@ -103,7 +103,7 @@ else else DEPLOYED_URL="" fi -fi +# fi # Output the final JSON