To get started you will need a working python install, either system-level or in a virtual
environment. Local requirements are managed using poetry and you should become familiar with the
basic commands of managing a poetry-based project. All requirements should be defined in
pyproject.toml, that is the source of truth!
Install requirements into your environment from the poetry.lock file.
poetry installPoetry is used to lock the requirements from pyproject.toml into poetry.lock (development),
reqs/requirements.txt (production) and reqs/dev-requirements.txt (ci/testing). You can use the
following command to re-sync the requirements from pyproject.toml to your environment and all
supporting files. This should be done after changing any requirements in pyproject.toml and the
results should be commit to git.
make update-envCopy the .env.template file to .env and make any changes you need to to configure both the
development and testing environments.
The tests are run through pytest. The configuration is location in pytest.ini.
To run the unit tests:
make testTo run a subset of tests you can use normal pytest filter features. To pass arguments to pytest
just set to ARGS variable.
make test ARGS="-k test_collect_single"You can also run them through pytest directly.
pytest
pytest -k test_collect_single$ python bundle.py --help
usage: bundle.py [-h] [--org ORG] [--name NAME] [--upload]
options:
-h, --help show this help message and exit
--org ORG
--name NAME
--uploadThere are three arguments that control what is uploaded to the firmware catalog.
org- Process bundles in this org (first folder in the path)name- Process bundles with this name (the YAML filename minus the suffix)upload- If we should upload the resulting bundle to the firmware catalog (Nexus)
Create firmware bundles with the name "all" in all organizations that have them
python bundle.py --name allCreate a firmware bundle for the organization "dell" with the name "all"
python bundle.py --org dell --name allAny of the above commands can be run with the --upload flag to upload the resulting bundle to the
firmware catalog. To do this you need to have (3) environmental variables set:
NEXUS_REPO- The URL to the firmware catalog (default: https://download.metify.io/repository/firmware-external/)NEXUS_USER- The username to use when uploading (default: ci)NEXUS_PASS- The password to use when uploading