Add a custom module to your app

This tutorial will show you how to add your existing code repository to Walhall as a module.

The key requirement is that the module is uploaded as a repository to your GitHub organization. Walhall imports modules directly from GitHub organizations.

Note: If your Walhall app uses BiFrost as an API gateway, then you must also configure your module to connect to BiFrost.

Technical requirements

Your module must satisfy these technical requirements before you can add it to your Walhall app:

Dockerfile

The module repository must contain a Dockerfile that builds an image of the module.

Your module must EXPOSE its content at port 8080. Example:

# Dockerfile
EXPOSE 8080
ENTRYPOINT ["bash", "/code/docker-entrypoint.sh"]

Drone file

The module repository must have a .drone.yml file at the root level. You can find a template here.

(Optional) Swagger documentation

If you want to connect your module to BiFrost, then your module must follow the OpenAPI (Swagger) specification and expose a Swagger file (swagger.json) at the /docs endpoint.

Add the module in Walhall

  1. Log in to Walhall and click on your app.
  2. In the box labeled Add new module, click Browse.
  3. A list of modules, derived from your organization’s repositories, will load. If you don’t see your module, then click Refresh the list. If you do, then click the Add button.
  4. Click Finish selection.

What happens next

The module will be added to your app. However, you must deploy the app again in order for the changes to take effect.

If your app includes BiFrost, then BiFrost will auto-discover the module’s IP address and Swagger file and add the endpoints to your app’s API.

If you’re not using BiFrost, then the module will be assigned its own public URL.