简体   繁体   中英

How to merge into a temporary branch before Jenkins build

I have the following Gitlab + Jenkins setup:

  1. I have a branch called "Develop"
  2. I have feature branches "F1", and "F2", and so forth.
  3. When the author of "F1" creates a merge request, Gitlab will trigger a Jenkins build, which currently checks out and builds F1.

I want Jenkins to do the following:

  1. Clone develop to a local branch named "Temp"
  2. Merge F1 to Temp
  3. Build my solution in Temp and Run the Tests
  4. Report the build result back to Gitlab

Is something like this possible in Jenkins? I know Git plugin has an option called "Checkout to a Specific local Branch", but I am not entirely sure if this does what I want.

Any help/input regarding this issue would be highly appreciated. Thanks and Cheers :)

There is a "merge before build" action in the Git plugin. It only merges on the build machine — it doesn't push the merge back to the origin repository.

“构建前合并”参数

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM