2
votes

I recently got to know Dockup and while I really love this kind of integration in Github, I am wondering if the same thing can be achieved in Gitlab, for free.

Basically, what I would like to achieve is:

  • On merge request, build tests and deploy in a dedicated environment which would use the name of the merge request
  • Send a message to a given slack about the environment or the failure of the build / tests in the pipeline with the related link of the pipeline

It seems that since Gitlab 11.6 it is possible to have Pipelines for merge requests but I don't really see how to get the information of the merge request or even who has submitted the merge request to use it for creating the dedicated deployment environment in my pipeline script?

How can I get that?

Note: It seems only a webhook can provide the information about the user and all the details.

1

1 Answers

3
votes

Found the information I wanted in https://docs.gitlab.com/ee/ci/variables

  • CI_MERGE_REQUEST_TITLE
  • CI_MERGE_REQUEST_PROJECT_URL
  • GITLAB_USER_NAME
  • CI_MERGE_REQUEST_ASSIGNEES

Probably won't even need to create a webservice for the webhook since everything can be found in the environment variables when running the pipeline script, this is pretty awesome!