Skip to content

Commit

Permalink
fix: update dev action yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Halil-Ibrahim-Kasapoglu authored Oct 20, 2024
1 parent 1f327f1 commit 235562f
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,30 @@ jobs:
kubectl set image deployment/backend backend=24cmpe451group2/backend:${{ github.sha }} --namespace=default
kubectl rollout status deployment/frontend --timeout=5m --namespace=default
kubectl rollout status deployment/backend --timeout=5m --namespace=default
echo "Checking the status of the frontend pods:"
FRONTEND_PODS_STATUS=$(kubectl get pods -l app=frontend --namespace=default -o jsonpath='{.items[*].status.phase}')
echo "Frontend pods status: $FRONTEND_PODS_STATUS"
if [[ $FRONTEND_PODS_STATUS != *"Running"* ]]; then
echo "Error: Frontend pods are not running. Current status: $FRONTEND_PODS_STATUS"
exit 1
fi
echo "Checking the status of the backend pods:"
BACKEND_PODS_STATUS=$(kubectl get pods -l app=backend --namespace=default -o jsonpath='{.items[*].status.phase}')
echo "Backend pods status: $BACKEND_PODS_STATUS"
if [[ $BACKEND_PODS_STATUS != *"Running"* ]]; then
echo "Error: Backend pods are not running. Current status: $BACKEND_PODS_STATUS"
exit 1
fi
echo "Deployment successful: Both frontend and backend pods are running."
EOF
echo "Checking the status of the frontend pods:"
FRONTEND_PODS_STATUS=\$(kubectl get pods -l app=frontend --namespace=default -o jsonpath='{.items[*].status.phase}')
echo "Frontend pods status: \$FRONTEND_PODS_STATUS"
if [[ -z "\$FRONTEND_PODS_STATUS" ]]; then
echo "Error: No frontend pods found."
exit 1
fi
if [[ "\$FRONTEND_PODS_STATUS" != *"Running"* ]]; then
echo "Error: Frontend pods are not running. Current status: \$FRONTEND_PODS_STATUS"
exit 1
fi
echo "Checking the status of the backend pods:"
BACKEND_PODS_STATUS=\$(kubectl get pods -l app=backend --namespace=default -o jsonpath='{.items[*].status.phase}')
echo "Backend pods status: \$BACKEND_PODS_STATUS"
if [[ -z "\$BACKEND_PODS_STATUS" ]]; then
echo "Error: No backend pods found."
exit 1
fi
if [[ "\$BACKEND_PODS_STATUS" != *"Running"* ]]; then
echo "Error: Backend pods are not running. Current status: \$BACKEND_PODS_STATUS"
exit 1
fi
echo "Deployment successful: Both frontend and backend pods are running."
EOF

0 comments on commit 235562f

Please sign in to comment.