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