Revolution is the software for the next generation electrical system for Blue Sky Solar Racing.
In project root directory, create a Python virtual environment.
python -m venv venv
Activate the Python virtual environment.
source venv/bin/activate
Install the project requirements.
pip install -r requirements.txt
Run style checker.
flake8 revolution configurations.py
Run static type checker.
mypy --strict revolution configurations.py
Run unit tests.
export REVOLUTION_CONFIGURATIONS_MODULE=revolution.tests.configurations
python -m unittest
Above is equivalent to below...
REVOLUTION_CONFIGURATIONS_MODULE=revolution.tests.configurations python -m unittest
Run documentation tests.
export REVOLUTION_CONFIGURATIONS_MODULE=revolution.tests.configurations
python -m doctest revolution/*.py
Above is equivalent to below...
REVOLUTION_CONFIGURATIONS_MODULE=revolution.tests.configurations python -m doctest revolution/*.py
Make sure all version occurrences have been updated.
Tag the release version.
git tag v<version>
Build the docker image.
docker build --no-cache -t blueskysolarracing/revolution:<version> .
Push the docker image.
docker push blueskysolarracing/revolution:<version>
In deployment platform, pull the docker image and run as a docker container in detached mode and make it always restart.
docker run -d --name revolution --privileged --restart always -v /dev:/dev -v /sys/class/pwm:/sys/class/pwm blueskysolarracing/revolution:<version>