Skip to content

Commit

Permalink
Updated Jenkinsfile
Browse files Browse the repository at this point in the history
Signed-off-by: Pradyot Ranjan <[email protected]>
  • Loading branch information
prady0t committed Dec 28, 2023
1 parent 32d0501 commit 2834e8d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pipeline {
}
}
}

stage("Push Image") {
steps {
// Authenticate with Docker Hub
Expand All @@ -40,5 +39,25 @@ pipeline {
}
}
}

stage('Update Deployment File') {
environment {
GIT_REPO_NAME = "CI-CD-pipeline-manifests"
GIT_USER_NAME = "prady0t"
}
steps {
withCredentials([string(credentialsId: 'Github', variable: 'GITHUB_TOKEN')]) {
sh '''
git config user.email "[email protected]"
git config user.name "prady0t"
BUILD_NUMBER=${BUILD_NUMBER}
sed -i "s/toBeReplaced/${BUILD_NUMBER}/g" mainfest/deployment.yaml
git add .
git commit -m "Update deployment image to version ${BUILD_NUMBER}"
git push https://${GITHUB_TOKEN}@github.com/${GIT_USER_NAME}/${GIT_REPO_NAME} HEAD:master
'''
}
}
}
}
}

0 comments on commit 2834e8d

Please sign in to comment.