V
V
Vladimir2020-04-28 10:42:27
Continuous Integration
Vladimir, 2020-04-28 10:42:27

How to separate creation of merge request and merge itself in jenkinsfile (gitlab)?

Hi using gitlab + jenkins to write a pipline (jenkinsfile on groovy) for a project.
When creating a merge request, there is a desire to process only the part of the jenkinsfile that is responsible for the tests (with confirmation that the code is working).
And after merge, work either all together with tests and deployment, or just deployment.
Found the merge request event handling in the integration option. but I don’t understand how to separate merge from just creation.
Perhaps this can be done through if and variables, but so far I can not find the desired environment variable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-04-28
@vitaly_il1

Perhaps this can be done through if and variables, but so far I can not find the desired environment variable.

I haven't worked with gitlab but as far as I understand merge request == pull request in github.
https://www.jenkins.io/doc/book/pipeline/syntax/#when - changeRequest (Merge Request on GitLab)
The merge itself is just a commit to the appropriate branch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question