This page documents the Makefile and build environment for synchronizers.
The synchronizer Makefile requires the following packages be installed:
Python
, preferably version 2.7 as well as a 3.x versiontox
, a framework for running unit tests. This should be installed using pip
, as older versions obtainable via apt
may be incompatible.build-essentials
and python-dev
, necessary to be able to setup the appropriate python virtual environmentsWhen starting work on a new synchronizer, we recommend using the Makefile from and existing synchronizer (olt-service is a good working example) as a starting point rather than writing a Makefile from scratch.
While each developer is free to create a custom Makefile, it is suggested for ease of integration that the following targets are available:
Builds a docker container for the synchronizer. The environment variables DOCKER_REGISTRY
. DOCKER_REPOSITORY
, and DOCKER_TAG
may be used to configure the name of the docker image that will be build. For example, the following command will build the image myname/mysynchronizer:test
.
DOCKER_REPOSITORY=myname/mysynchronizer DOCKER_TAG=test make docker build
This target will push a docker image that was built using make docker-build
to dockerhub or another docker registry.
This target runs all tests on the repository that are appropriate for acceptance testing. Typically it invokes other Makefile targets such as make test-unit
, make test-migration
, and make test-xproto
.
This target runs tox
to execute unit tests and generate a coverage report.
This target checks that xproto migrations are up-to-date.
This target runs a linting check of the xproto files to ensure that the xproto is syntactically correct and that it obeys several semantic rules.
This target will create or update the database migration scripts from the service's current xproto.
This target removes all build artifacts, including the contents of virtual environments that are built, as well as unit testing coverage reports and results.