Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Add ability to override device tag #4

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SOTA_DIR = /var/sota

DEVICE_FACTORY ?= ${FACTORY}
DEVICE_TOKEN ?= ${AUTH_TOKEN}
DEVICE_TAG ?= main

.PHONY: config build

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docker/.env.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FACTORY=$FACTORY
AUTH_TOKEN=$USER_TOKEN
DEVICE_TAG=main

DEV_DIR=$PWD/.device
SOTA_DIR=$DEV_DIR/sota
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
Loading