update Jenkinsfile for workflow gitops
This commit is contained in:
parent
642ab59f5e
commit
663ddd17d0
|
|
@ -65,11 +65,13 @@ pipeline {
|
|||
|
||||
withCredentials([usernamePassword(credentialsId: 'gitea-token-gitops', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
|
||||
branches.each { envSet ->
|
||||
sh """
|
||||
echo "=============================="
|
||||
echo "Updating GitOps for branch: ${envSet.name}"
|
||||
echo "=============================="
|
||||
|
||||
// Gunakan block dengan masking aktif
|
||||
sh(
|
||||
script: """
|
||||
# Install yq kalau belum ada
|
||||
if ! command -v ./yq &> /dev/null; then
|
||||
echo "Installing yq locally..."
|
||||
|
|
@ -96,7 +98,9 @@ pipeline {
|
|||
|
||||
cd ..
|
||||
rm -rf gitops
|
||||
"""
|
||||
""",
|
||||
mask: true // <--- ini kunci masking password dari log
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -106,14 +110,14 @@ pipeline {
|
|||
|
||||
post {
|
||||
success {
|
||||
echo "✅ GitOps update successful — all branches (dev, staging, prod) updated!"
|
||||
echo "GitOps update successful — all branches (dev, staging, prod) updated!"
|
||||
}
|
||||
failure {
|
||||
echo "❌ Pipeline failed, check Jenkins logs for details."
|
||||
echo "Pipeline failed, check Jenkins logs for details."
|
||||
}
|
||||
always {
|
||||
cleanWs()
|
||||
echo "🧹 Workspace cleaned up."
|
||||
echo "Workspace cleaned up."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue