Authoring new tools
This document describes the process for authoring new tools for the uniget installer and updater.
Tools are packaged, stored and transported as container images but containerization is not used to execute the tools. After the installation, tools are available natively. For more details, see concepts.
- Fork and clone the tools repository
- Create a new branch
- Create a new directory under
tools/
for your tool - You can either bwegin from scratch or...
- Add files from
@template/
to your new directory - Copy from an existing tool
- Add files from
Editing manifest.yaml
:
- Refer to manifest to customize
manifest.yaml
. Mind that thename
field must match the name of the subdirectory - Make sure the
tags
contain relevant tags. Please refer to similar tools for inspiration - If the binary for your tool has a different name, use the
binary
field in themanifest.yaml
. A relative path will be resolved to${target}/bin
. An absolute path should start with the placeholder${target}
Mind the following when customizing Dockerfile.template
- All files must be placed under
/uniget_bootstrap
- The file requires a final target called
prepare
-
If you rely on an existing tool to package your tool, declare the respective container image first, e.g.
make
:FROM ghcr.io/uniget-org/tools/make:latest AS make
If you are using a pinned version instead of the
latest
tag, the tag will not get renovated. This is not recommended.The copy the contents into your image:
COPY --from=make / /usr/local
Also add these dependencies to the
build_dependencies
field inmanifest.yaml
-
If you rely on an existing tool to execute your tool (e.g.
go
ormake
), add the dependencies to theruntime_dependencies
field inmanifest.yaml
- Examples for many scenarios are included in
@template/Dockerfile.template
Package locally:
- Build the container image for your new tool named
TOOL
:make TOOL--debug
- Check if only the required files are located under
/uniget_bootstrap
- Test that the binary if present under
/uniget_bootstrap/bin/
- Check that the binary can be executed
- Determine the command to extract the version
- Update the
version
field in yourmanifest.yaml
. Use the placeholder${binary}
instead of the binary name
- Check if only the required files are located under
- Update the Renovate configuration:
make renovate.json
Install locally:
uniget
is only able to install from the official repository once the tool is released.
But there is a workaround which involves creating a tarball which can be used to install the tool locally:
- Create the tarball for your local platform:
make TOOL--tar
- Force
uniget
to install from the tarball:uniget install --path-to-tar-mappings=TOOL=tools/TOOL/image.tar
--path-to-tar-mappings
accepts a comma-separated list of TOOL=PATH
mappings.
Submit your contribution:
- Commit the changes
- Include
tools/TOOL/manifest.yaml
- Include
tools/TOOL/Dockerfile.template
- Include any additional files required to package the tool
- Include
renovate.json
- Include
- Open a pull/merge request