.. _providers-section: ==================== Repository Providers ==================== Repository Providers (or RepoProviders) are locations where repositories are stored (e.g., GitHub). BinderHub supports a number of providers out of the box, and can be extended to support new providers. For a complete listing of the provider classes, see :ref:`api-repoproviders`. Supported repoproviders ======================= Currently supported providers, their prefixes and specs are: .. table:: :widths: 5 5 55 35 +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Provider | provider_prefix | spec | notes | +============+====================+=============================================================+===========================================================================================================================================+ | GitHub | ``gh`` | ``//`` | `GitHub `_ is a website for hosting and sharing git repositories. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | GitLab | ``gl`` | ``/`` | `GitLab `_ offers hosted as well as self-hosted git repositories. | | | | (e.g. ``group%2Fproject%2Frepo/main``) | | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Gist | ``gist`` | ``/`` | `Gists `_ are small collections of files stored on GitHub. They behave like lightweight repositories. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Zenodo | ``zenodo`` | ```` | `Zenodo `_ is a non-profit provider of scholarly artifacts (such as code repositories) run in partnership with CERN. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Figshare | ``figshare`` | ```` | `FigShare `_ is a company that offers hosting for scholarly artifacts (such as code repositories). | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | HydroShare | ``hydroshare`` | ```` | `HydroShare `_ is a hydrologic information system for users to share and publish data and models. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Dataverse | ``dataverse`` | ```` | `Dataverse `_ is open source research data repository software installed all over the world. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Git | ``git`` | ``/`` | A generic repository provider for URLs that point directly to a git repository. | +------------+--------------------+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ Adding a new repository provider ================================ It is possible to add new repository providers to BinderHub, allowing a BinderHub deployment to fetch repositories from new locations on the web. Doing so involves defining your own RepoProvider sub-class and modifying a set of methods/attributes to interface with the online provider to which you are providing access. It also often involves `building a new repo2docker content provider `_. In order to extend the supported repository providers, follow these instructions. We'll provide example links for each step to a recent `BinderHub pull-request `_ that implements the ``DataverseProvider`` class. #. Review the `repoprovider module `_. This shows a number of example repository providers. #. Check whether repo2docker has a `ContentProvider class `_ that will work with your repository provider. If not, then you'll need to create one first. #. Create a new class that sub-classes the ``RepoProvider`` class. Define your own methods for actions that are repository provider-specific. For example, `here is the DataverseProvider class `_. #. Add this class to the `list of default RepoProviders in BinderHub `_. #. Add the new provider prefix `to the BinderHub UI `_ and `the index javascript `_ and make the appropriate changes to the index page based on the URL specification for this repository provider. #. Add `a test for your repoprovider `_ to ensure that it properly resolves and fetches a repository URL. #. Document your new repository provider on the :ref:`providers-section` page as well as the :ref:`api-repoproviders` page.