# gitlab_lfs_mirror plugin

## gitlab_lfs_mirror - plugin for accessing files stored in git-lfs on GitLab

Note

The `gitlab_lfs_mirror` plugin is available Since 2.4.0

If you store files in a git-lfs repository on gitlab.com, you can access them using a URL like

https://gitlab.com/path/to/repo/-/raw/master/path/to/file

which you can then use as a mirror for buildstream. However this only works for public repositories. For internal (on self-hosted GitLab instances) and private repositories, the above doesn’t work since buildstream cannot authenticate with the GitLab web UI.

This plugin solves this by going through the GitLab REST API. You need an access token that access the Repository Files API (i.e. with read_api or read_repository scope). As of this writing, the GitLab CI/CD job token doesn’t allow access to this API endpoint, so you need a dedicated access token.

Usage:

    - name: my-mirror
      kind: gitlab_lfs_mirror
      config:
        url: https://gitlab.example.com/
        project: mirrors/{alias}
        ref: main # optional, defaults to master
        aliases:
        - my-alias
        - another-alias