Reputation: 109
My objective is to trigger a build on Git repo A whenever there is commit/Pull request done on Git Repo B. Git repo has all the pipeline code as separate groovy code and Git Repo b has the application Code done by dev team. I would like to test the case where a commit done in pipeline code is triggering the build in application code. How can I acheive this using Jenkins 2 with pipeline? Any thoughts or approach how it is done is greatly appreciated.
Here is my jenkinsfile in Git repo A.
branches {
masterBranch = 'master'
}
integration {
pullRequest {
version = gradle {
goals = 'clean build'
gradlePath = '/gradle-4.1/bin/gradle'
}
}
master {
version = gradle {
goals = 'clean build'
gradlePath = '/gradle-4.1/bin/gradle'
}
}
}
Upvotes: 0
Views: 327
Reputation: 6519
So you need to create 2 jobs
then use "Parameterized Trigger Plugin" to build required job( repo A ) based on the previous build status.
Upvotes: 0