These tools are work in progress
mgradmused to help administer Uyuni servers on Podmanmgrctlused to help managing Uyuni servers mainly through its APImgrpxyused to help managing Uyuni proxies
- Instructions for the Uyuni Stable version: https://www.uyuni-project.org/pages/stable-version.html
- Instructions for the Uyuni Development/Master version: https://www.uyuni-project.org/pages/devel-version.html
NOTE: If you want to deploy Development/Master you need to specify --image systemsmanagement/uyuni/master/containers/uyuni/server for the server.
Other sub-commands are also available. Explore the tool with the help command.
A tool named mgrctl is also available with useful commands.
pre-commit helps validating the code before submitting it. Please install the hooks on your machine to enable them:
zypper in python3.XX-pre-commit
./install-hooks.sh
There are two kind of hooks used in this project:
pre-commitones are fast checks that are running on each commit.pre-pushones are the lengthier ones like builds and unit tests and are only executed when pushing to a remote branch.
The hooks can also all be run manually at any time with pre-commit run -a.
Signing commits with a GPG/SSH key is mandatory for contributing. That way your commits will be marked as verified on GitHub so other people can be confident that the changes come from a trusted source.
If you are not doing it already, check out the GitHub documentation.
Create the bin directory if it does not exist:
mkdir bin
And then build:
go build -o ./bin ./... will produce the binaries in the root folder with 0.0.0 as version.
To produce shell completion scripts for a given shell you can run:
./bin/mgradm completion <shell> > $COMPLETION_FILEfor mgradm./bin/mgrctl error completion <shell> > $COMPLETION_FILEfor mgrctl
You'll then need to source the resulting script(s).
As an example, to enable bash completion for mgradm:
./bin/mgradm completion bash > ./bin/completion
. ./bin/completion
The supported shells are: bash, zsh and fish.
Alternatively, if you have podman installed you can run the build.sh script to build binaries compatible with any x86_64 linux.
The version will be computed from the last git tag and offset from it.
In order to adjust the image, tag and chart to the project the package is built in, add the following at the end of the project configuration:
Macros:
%_default_tag yourtag
%_default_image theregistry.org/path/to/the/server
%_default_chart oci://theregistry.org/path/to/the/chart
:Macros
To disable features at build time pass the -tags parameter with the following values in a comma-separated list:
ptf: will enable ptf support commands build
For Localization the project uses gettext.
There are a few rules to follow to make strings localizable:
Add the following import in the go file and then wrap all the strings that could be localized in the L(), NL() or PL() function.
. "github.com/uyuni-project/uyuni-tools/shared/l10n"
L("my message"): is the simple form to localize a string and will be used most oftenNL("my %d message", "my %d messages", count): should be used when a message has a plural formPL("some context", "my message"): should be used if a string is hard to understand without some additional context. Remember that translators don't read the code.
Global variables and constants are evaluated before running the main function and thus do not take the locale into account. Move them in a function to work around this issue.
The translation takes place on Weblate. Look for the uyuni-tools-* components there.
The pot and po files should not be changed in PRs as the synchronization is part of a semi-automated workflow.