'How can we trigger gitlab-ci before pushing to repository?

I want to implement pre-receive hooks on the GitLab server side but we don't have access to the file system. Is there any way I can handle it with GitLab-ci? I want to get control over what can and can't be pushed to the repository.



Solution 1:[1]

One possible workaround would be for developers to:

  • push to a gateway repository
  • pull from an official one.

(both on GitLab)

You can then associate a job on the first one, on push:, in order to validate what has been pushed.
If validated, the job push the commit to the second official repository.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC