How to build¶
Preparation¶
-
Install packages
-
For Ubuntu 22.04 and 24.04 (Debian should work too):
-
On Ubuntu 24.04 a new clang version than
15
can also be used or g++. See supported versions
-
-
Clone repository with submodules
-
In case the repo was cloned without submodules initially:
Build hamami plain¶
-
Compile hanami
-
In case you also want to compile the unit-tests and so on, you have to add
-Drun_tests=ON
to the cmake-commands -
Resulting binary
Build hanami as docker-image¶
With docker-build¶
Run docker build -t <DOCKER_IMAGE_NAME> .
With earthly¶
-
Install earthly
-
The code can be build as image like this:
Build CLI-client¶
-
Install earthly
-
build protobuf-messages within the hanami_sdk directory
-
then you have a new local directory
builds
, where the resulting binary of the build-process is placed into
Build python-SDK as package¶
-
install packages
-
build protobuf-messages and package
Prechecks¶
There are a bunch of pre-checks at the beginning of the CI-pipeline, which can fail and where it is useful to be able to run the same tests locally for debugging. Nearly all of them use earthly
Flake8-check¶
- run
earthly --ci +flake8
Secret-scan¶
- run
earthly --ci +secret-scan
It is possible, that the check fails, even if there are no (new) secrets in the code and fails,
because of some other code-movements. The check compares all to the .secrets.baseline
-file, where
also line-numbers are marked. To update the file to get the test green again:
-
install detect-secrets
-
update file with
detect-secrets scan > .secrets.baseline
Ansible-lint¶
- run
earthly --ci +ansible-lint
Cpp-check¶
- run
earthly --ci +cppcheck
Clang-format check¶
- run
earthly --ci +clang-format
Build docs¶
-
The documenation can be build as image like this:
-
The documentation listen on port 8000 within the docker-container. So the port has to be forwarded into the container:
-
After this within the browser the addess
127.0.0.1:8080
can be entered to call the documenation within the browser.
Run preview of docs¶
-
Install Mkdocs and plugins
-
To build the documentation
Draw.io
also has to be installed on the system-
Example how to install draw.io
-
-
checkout repository and run the local server
-
Open web-browser with address
http://127.0.0.1:8000/
to see the docs. Themkdocs serve
-command runs in the background and makes live-updates of all changes within the files.