Merge Request Build Job with GitLab CI

I am switching from Jenkins to GitLab CI with GitLab runner.

On Jenkins we had merge request builds when a merge request was created and the Jenkins do a merge before build job.

How ist this possible with GitLab CI?

@jensamberg That actually is a feature in GitLab now, you can enabled Pipelines for Merged Results by configuring your pipelines. You can also read more about merge trains about lining up merges so that you can ensure the main branch is always “green”

1 Like

@olearycrew thanks for answer. We have only GitLab Starter.

Now I recognised that we need Premium for that feature. Is there any workaround you can suggest

@jensamberg a workaround may be to do it in two branches.

e.g. you can use a develop branch as what you branch off of for feature branches, then you only merge completed and tested changes from develop to master or main. This is similar to a simplified “git-flow”. Gives you develop as a branch for kind of “staging” those changes.

1 Like

@olearycrew thanks for suggestion. Is there also maybe a way to do a kind if if statement. And if the build is from a Merge requests I run the git merge command manuel?