Update apps/demo-nginx/Jenkinsfile
This commit is contained in:
11
apps/demo-nginx/Jenkinsfile
vendored
11
apps/demo-nginx/Jenkinsfile
vendored
@@ -291,10 +291,10 @@ EOF
|
||||
stage('Wait for ArgoCD Sync') {
|
||||
steps {
|
||||
script {
|
||||
echo "⏳ Waiting for ArgoCD to apply Git revision..."
|
||||
echo "⏳ Waiting for ArgoCD to apply GitOps revision..."
|
||||
|
||||
def expectedRevision = sh(
|
||||
script: "git rev-parse HEAD",
|
||||
script: "git -C k3s-gitops rev-parse HEAD",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
@@ -309,19 +309,19 @@ EOF
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
echo "Expected Git revision : ${expectedRevision}"
|
||||
echo "Expected GitOps revision : ${expectedRevision}"
|
||||
echo "ArgoCD applied revision : ${argoRevision}"
|
||||
echo "ArgoCD sync status : ${syncStatus}"
|
||||
|
||||
if (syncStatus == "Synced" && argoRevision == expectedRevision) {
|
||||
echo "✅ ArgoCD successfully applied Git revision"
|
||||
echo "✅ ArgoCD successfully applied GitOps revision"
|
||||
return
|
||||
}
|
||||
|
||||
sleep 10
|
||||
}
|
||||
|
||||
error("❌ ArgoCD did not apply expected Git revision in time")
|
||||
error("❌ ArgoCD did not apply expected GitOps revision in time")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,6 +330,7 @@ EOF
|
||||
|
||||
|
||||
|
||||
|
||||
stage('Wait for Deployment') {
|
||||
when { branch 'main' }
|
||||
steps {
|
||||
|
||||
Reference in New Issue
Block a user