Skip to content

uyuni-project/uyuni-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,955 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REUSE status

Tools to help using Uyuni as containers

These tools are work in progress

  • mgradm used to help administer Uyuni servers on Podman
  • mgrctl used to help managing Uyuni servers mainly through its API
  • mgrpxy used to help managing Uyuni proxies

Deployment rolling release

For Podman deployment for the Server

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.

Development documentation

Install pre-commit hooks

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-commit ones are fast checks that are running on each commit.
  • pre-push ones 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.

Sign your Git commits

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.

Building

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.

Extras

To produce shell completion scripts for a given shell you can run:

  • ./bin/mgradm completion <shell> > $COMPLETION_FILE for mgradm
  • ./bin/mgrctl error completion <shell> > $COMPLETION_FILE for 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.

Building in Open Build Service

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

Disabling features at build time

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

Localization

Developer tricks

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 often
  • NL("my %d message", "my %d messages", count): should be used when a message has a plural form
  • PL("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.

Translating

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.

Packages

 
 
 

Contributors

Languages