fix: checkout application repo stage

This commit is contained in:
adelyaou 2025-10-22 15:26:59 +07:00
parent 0767b42851
commit 5d59eeb6ba
1 changed files with 39 additions and 31 deletions

10
Jenkinsfile vendored
View File

@ -40,12 +40,15 @@ pipeline {
stage('Checkout Application Repo') {
steps {
dir('app') {
checkout scm
}
}
}
stage('Build and Push Docker Image') {
steps {
dir('app') {
script {
def tag = params.IMAGE_TAG ?: "build-${env.BUILD_NUMBER}"
echo "Building and pushing image with tag: ${tag}"
@ -65,10 +68,11 @@ pipeline {
}
}
}
}
stage('Checkout Manifest Repo') {
steps {
script {
dir('manifest') {
checkout([$class: 'GitSCM',
branches: [[name: env.BRANCH]],
userRemoteConfigs: [[url: env.MANIFEST_REPO, credentialsId: env.MANIFEST_CRED_ID]]
@ -79,6 +83,7 @@ pipeline {
stage('Update Image Tags in Manifests') {
steps {
dir('manifest') {
script {
echo "Updating manifests to tag: ${env.IMAGE_TAG_FINAL}"
@ -91,9 +96,11 @@ pipeline {
}
}
}
}
stage('Commit & Push Manifest Updates') {
steps {
dir('manifest') {
withCredentials([usernamePassword(credentialsId: env.MANIFEST_CRED_ID, usernameVariable: 'GIT_USER', passwordVariable: 'GIT_PASS')]) {
sh """
git config user.email "jenkins@local"
@ -105,6 +112,7 @@ pipeline {
}
}
}
}
stage('ArgoCD Sync (optional)') {
steps {