Wajahat Lateef
Wajahat Lateef

Reputation: 77

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.

Upvotes: 1

Views: 810

Answers (2)

Wajahat Lateef
Wajahat Lateef

Reputation: 77

It's possible to implement pre-recieve hooks in gitLab but that comes when we have access to file system. For now, I have added gitlab-ci that will check on every merge request on protected branches and let all developers push to temp branches.

Upvotes: 2

VonC
VonC

Reputation: 1323223

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.

Upvotes: 2

Related Questions