Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions src/deployer/deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,30 @@ function deployPH(){
# we can count the sucessful BPMN uploads and be confident that they are working
#deployBPMS

# Add stability check for vNext
echo " Waiting for phee to be stable..."
kubectl wait --for=condition=Ready pod --all -n "$PH_NAMESPACE" --timeout=300s
if [ $? -ne 0 ]; then
echo -e "${RED}phee failed to stabilize. Exiting.${RESET}"
exit 1
fi
NAMESPACE="$PH_NAMESPACE"
STABLE_COUNT=0

while [ $STABLE_COUNT -lt 3 ]; do
NOT_READY=$(kubectl get pods -n "$NAMESPACE" --no-headers | awk '$2 != "1/1"')

if [ -z "$NOT_READY" ]; then
STABLE_COUNT=$((STABLE_COUNT + 1))
echo "✅ All pods ready. Stable count: $STABLE_COUNT"
else
STABLE_COUNT=0
echo "❌ Some pods not ready. Waiting..."
fi
sleep 60
done
echo "🎉 All pods are stable and running."
echo " phee is stable"
echo -e "\n${GREEN}============================"
echo -e "Paymenthub Deployed"
echo -e "============================${RESET}\n"
Expand Down Expand Up @@ -531,6 +555,29 @@ function deployInfrastructure () {
fi
check_command_execution "Deploying infra helm chart"
echo " [ok] "

# Add stability check for infrastructure
echo " Waiting for infrastructure to be stable..."
kubectl wait --for=condition=Ready pod --all -n "$INFRA_NAMESPACE" --timeout=840s
if [ $? -ne 0 ]; then
echo -e "${RED}Infrastructure failed to stabilize. Exiting.${RESET}"
exit 1
fi
NAMESPACE="$INFRA_NAMESPACE"
STABLE_COUNT=0

while [ $STABLE_COUNT -lt 3 ]; do
NOT_READY=$(kubectl get pods -n "$NAMESPACE" --no-headers | awk '$2 != "1/1"')
if [ -z "$NOT_READY" ]; then
STABLE_COUNT=$((STABLE_COUNT + 1))
echo "✅ All pods ready. Stable count: $STABLE_COUNT"
else
STABLE_COUNT=0
echo "❌ Some pods not ready. Waiting..."
fi
sleep 10
done
echo "🎉 All pods are stable and running."
echo -e "\n${GREEN}============================"
echo -e "Infrastructure Deployed"
echo -e "============================${RESET}\n"
Expand Down Expand Up @@ -696,6 +743,31 @@ function deployvNext() {
echo -e " Proceeding ..."
fi
done

# Add stability check for vNext
echo " Waiting for vNext to be stable..."
kubectl wait --for=condition=Ready pod --all -n "$VNEXT_NAMESPACE" --timeout=600s
if [ $? -ne 0 ]; then
echo -e "${RED}vNext failed to stabilize. Exiting.${RESET}"
exit 1
fi
NAMESPACE="$VNEXT_NAMESPACE"
STABLE_COUNT=0

while [ $STABLE_COUNT -lt 3 ]; do
NOT_READY=$(kubectl get pods -n "$NAMESPACE" --no-headers | awk '$2 != "1/1"')

if [ -z "$NOT_READY" ]; then
STABLE_COUNT=$((STABLE_COUNT + 1))
echo "✅ All pods ready. Stable count: $STABLE_COUNT"
else
STABLE_COUNT=0
echo "❌ Some pods not ready. Waiting..."
fi
sleep 180
done
echo "🎉 All pods are stable and running."
echo " vNext is stable"

## don't do this by default for gazelle v1.1.0 as for v1.1.0 we now have Mifos greenbank/bluebank as much more realistic DFSPs
## It is true that in for vNext or subseqent we might want TTKs for debug and testing purposes hence leaving this here for the moment
Expand Down
2 changes: 2 additions & 0 deletions src/environmentSetup/environmentSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ function envSetupMain {
$UTILS_DIR/install-k9s.sh > /dev/null 2>&1
else
checkHelmandKubectl # ensure things really are in place properly
# Ensure /etc/hosts is refreshed on every deploy (covers cases where boot removed entries)
add_hosts
fi
install_nginx $environment $k8s_distro # will skip if already running
checkClusterConnection
Expand Down