Skip to content

Commit

Permalink
Update CI/CD workflow to use subdomain for application health check
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMgeeth committed Dec 30, 2024
1 parent 78af8d3 commit 7d0ed9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/rh_dev_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
WAR_NAME="rh.war"
WAR_DIR="/home/appuser/app/latest"
APP_NAME="rh"
SUBDOMAIN="dev"
# Ensure deployment directory exists
ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "
Expand Down Expand Up @@ -129,12 +130,12 @@ jobs:
# Check if the application is reachable
for i in {1..5}; do
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://'$APP_NAME'.carecode.org/'$APP_NAME'/faces/index1.xhtml)
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://'$SUBDOMAIN'.carecode.org/'$APP_NAME'/faces/index1.xhtml)
if [ "$RESPONSE_CODE" == "200" ]; then
echo "Application is reachable and healthy."
break
elif [ "$i" == "5" ]; then
echo "Application is not reachable or unhealthy at https://'$APP_NAME'.carecode.org/'$APP_NAME' (HTTP $RESPONSE_CODE)"
echo "Application is not reachable or unhealthy at https://'$SUBDOMAIN'.carecode.org/'$APP_NAME' (HTTP $RESPONSE_CODE)"
break
fi
sleep 10
Expand Down

0 comments on commit 7d0ed9b

Please sign in to comment.