diff --git a/Makefile b/Makefile index d1762f2..8824e31 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ SOTA_DIR = /var/sota DEVICE_FACTORY ?= ${FACTORY} DEVICE_TOKEN ?= ${AUTH_TOKEN} +DEVICE_TAG ?= main .PHONY: config build @@ -26,7 +27,7 @@ ${SOTA_DIR}: mkdir -p ${SOTA_DIR}/compose-apps register: ${SOTA_DIR} - DEVICE_FACTORY=${DEVICE_FACTORY} lmp-device-register -T ${DEVICE_TOKEN} --start-daemon 0 -d ${SOTA_DIR} -t master + DEVICE_FACTORY=${DEVICE_FACTORY} lmp-device-register -T ${DEVICE_TOKEN} --start-daemon 0 -d ${SOTA_DIR} -t ${DEVICE_TAG} unregister: @rm -rf ${SOTA_DIR}/sql.db diff --git a/README.md b/README.md index 8aec3e3..2e2d980 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Run `./dev-shell.sh`. The initial/first run may take some time as necessary cont ## Register/Unregister device Inside the development container, run `make register` or `make unregister` to register or unregister a device, respectively. +Override the `DEVICE_TAG` environment variable if you need to register a device and set its tag to a non-default value (`main`). +For example, `DEVICE_TAG=devel make register`. ## Build your SOTA client Run `make` to build your SOTA (Software Over-The-Air) client. diff --git a/docker/.env.dev b/docker/.env.dev index 0bfc5bb..e5ceadc 100644 --- a/docker/.env.dev +++ b/docker/.env.dev @@ -1,5 +1,6 @@ FACTORY=$FACTORY AUTH_TOKEN=$USER_TOKEN +DEVICE_TAG=main DEV_DIR=$PWD/.device SOTA_DIR=$DEV_DIR/sota diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 67129ac..435794e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -33,6 +33,7 @@ services: environment: - FACTORY=${FACTORY} - AUTH_TOKEN=${AUTH_TOKEN} + - DEVICE_TAG=${DEVICE_TAG} - DOCKER_HOST=unix:///var/run/docker/docker.sock - DOCKER_CONFIG=/usr/lib/docker - CXX=clang++