Reputation: 1205
What is the difference between a these Jenkins project types:
Pipeline
Multi Branch Pipeline
Github Organization
I am using a Jenkinsfile.
I think for Pipeline, it just supports one Branch, where as Multi Branch supports any branch. Github Organization not sure. I want to update Pull Request from Github with Jenkins build statuses.
Upvotes: 1
Views: 1193
Reputation: 6869
Pipeline job is basically asking Jenkins to run a pipeline written in Groovy. You either "paste" this Groovy code into a text field in Jenkins, or tell Jenkins "the Groovy code is somewhere there in the SCM". Your job is "freestyle" and so can do anything — make cleanups, send emails, or download cat pictures, and, of course, it can roll the build-test-deploy cycle.
Note that your job may, for example, ask for branch name, and build several branches provided with their names. (Theoretically, it can also ask for repo URL, and build several repos.)
Multibranch job basically tells Jenkins that there's a repo that has several branches (some of them PRs). This is better fit for build-test-deploy cycle. In this type, each branch has its own Jenkinsfile (it was created when the branch was forked from master
or whatever), and each branch is built according to its own Jenkinsfile.
This is what most people want, and here's why: Let's assume the "usual" project build delivers three deliverables (binaries, tars, jars or whatever), and I have a PR that adds a fourth one. Where would I put the instructions on how to build this fourth thing? In Multibranch, I add the instructions to my branch's Jenkinsfile. My branch produces four deliverables, the other branches three. When my branch is merged, master branch gets to four, etc.
(In a single pipeline, I'd need to modify my single project-wide Jenkinsfile with if-else instructions, and this could quickly get out of hand.)
Github Organization is very similar, but has closer integration with GitHub, so is only relevant if this is what you work with (not relevant for e.g. BitBucket).
Upvotes: 2
Reputation: 1323653
In a pipeline job, you specify in which branch your Jenkinsfile is.
But in a Multibranch Pipeline, each branch can have its own Jenkinsfile.
The GitHub Organization folder is used to scan a GitHub Organization or Bitbucket Team to discover an organization’s repositories, automatically creating managed Multibranch Pipeline jobs for them.
update Pull Request from Github with Jenkins build statuses
You can follow "How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]", which uses a WebHook.
Or you can use the GitHub PR Builder Plugin
Upvotes: 1