Are there any kind of API hooks?

This is in context of a former question about influencing downloaded archives created using the API. I would like to deploy some files stored in a GIT repo using the file archive API as ZIP download to customers, with the important point that I would like to influence the name of the created ZIP archive, the contained root directory and stuff. This doesn’t seem to be possible easily, so I’ve investigated available server side hooks and alike. While there seem to be such for interacting with GIT-repos themself, admin maintenance like creating groups etc., I didn’t find anything helpful for my use-case.

What I would need is some server-side hook registering for individual projects or alike and getting triggered on special requests to the API, like when customers request the following URL:[...]&sha=v2/v2.11.1

I know of CI/CD, but would like to avoid pre-creating deployment archives and the necessary housekeeping, like deleting old deployments and stuff. Creating the ZIP-archives on-demand was fast enough until now, so I hoped with some kind of hook I could enhance the server-side process to apply my changes on-the-fly somehow. Maybe using some custom GIT ARCHIVE backend or alike.

So, are there any kind of API hooks?


You don’t need API hooks to manipulate the filename, you can do it with curl easily enough. See a script I use:

# Variables

# Download file
# If probs with cert use --insecure
curl --header "PRIVATE-TOKEN: $TOKEN" $URL --output $DLPATH/

as you see I use --output which is a curl option to output to a particular filename. You cannot manipulate the repository archive name, it is either or archive.tar.bz2 or whatever. The Gitlab API doesn’t allow you to manipulate that. The only way you can control filename, is to make releases from tags and name your files appropriately - but then you know about that already as you mentioned it.

Customers should only copy a link into their browser and that’s it, no client-side scripts or anything.