Update apps/demo-nginx/Jenkinsfile

This commit is contained in:
2026-01-08 15:00:24 +00:00
parent 8e343980a4
commit 264ea7591d

View File

@@ -293,32 +293,25 @@ EOF
stage('Wait for ArgoCD Sync') {
steps {
script {
echo "⏳ Waiting for ArgoCD to apply GitOps image..."
for (int i = 1; i <= 18; i++) {
echo "⏳ Waiting for ArgoCD to sync manifests..."
for (int i = 1; i <= 12; i++) {
def syncStatus = sh(
script: "kubectl get application demo-nginx -n argocd -o jsonpath='{.status.sync.status}'",
returnStdout: true
).trim()
def images = sh(
script: "kubectl get application demo-nginx -n argocd -o jsonpath='{.status.summary.images}'",
returnStdout: true
).trim()
echo "ArgoCD sync status : ${syncStatus}"
echo "ArgoCD images : ${images}"
if (syncStatus == "Synced" && images.contains(IMAGE_TAG)) {
echo "✅ ArgoCD successfully applied image ${IMAGE_TAG}"
if (syncStatus == "Synced") {
echo "✅ ArgoCD manifests synced"
return
}
sleep 10
}
error("❌ ArgoCD did not apply image ${IMAGE_TAG} in time")
error("❌ ArgoCD did not sync manifests in time")
}
}
}
@@ -331,6 +324,7 @@ EOF
stage('Wait for Deployment') {
when { branch 'main' }
steps {