Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 2.69 KB

File metadata and controls

93 lines (65 loc) · 2.69 KB

Mojo - Firmware Catalog Development

Getting Started

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!

Environment Setup

Install requirements into your environment from the poetry.lock file.

poetry install

Poetry 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-env

Development Configuration

Copy the .env.template file to .env and make any changes you need to to configure both the development and testing environments.

Testing

The tests are run through pytest. The configuration is location in pytest.ini.

To run the unit tests:

make test

To 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

Running (CLI)

$ 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
  --upload

There 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 all

Create a firmware bundle for the organization "dell" with the name "all"

python bundle.py --org dell --name all

Any 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: