I have a folder inside D:/TestFolder/ Now I need to git pull inside TestFolder using Jenkins every time I trigger a job. How is it possible?
Can anyone guide me on Jenkins git pull in a particular folder?
git plugins for Jenkins come with that option -
If you are using Jenkins freestyle job,
If you are using Jenkins scripted pipeline, It will be like
node() {
stage('checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'sub_folder']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'credentialId', url: 'http://repourl.net/x.git']]])
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.