Reputation: 331
I'm using Jenkins with declarative pipeline and I need to create a job triggered by any modification on a repo repository and all dependent projects inside the manifest.
Actually I've to do the following fetch and trigger all my dependencies:
pipeline {
agent any
stages {
stage('fetch') {
steps {
sh 'repo init -u ${MY_REPO_URL}'
sh 'repo sync'
}
}
}
}
In a Freestyle project with repo plugin, I only need to add:
But there is no "Source Code Management" in a pipeline job
What can I do ?
Thanks
Upvotes: 1
Views: 1658
Reputation: 331
Ok, what I wasn't understanding is that pollSCM autodetect repo project. So with scheduled trigger, all repositories are checked.
Also, with the pipeline syntax generator I've found this pretty way for init and sync my repository:
checkout changelog: true, poll: false, scm: [$class: 'RepoScm', currentBranch: true, \
forceSync: true, jobs: 4, manifestBranch: manifestRev, \
manifestRepositoryUrl: manifestRepo, \
quiet: false, resetFirst: fullClean, resetFirst: fullReset]
Upvotes: 1