Skip to content

Commit

Permalink
docker: Add ability to override device tag
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Sul <mike.sul@foundries.io>
  • Loading branch information
mike-sul committed Jul 11, 2024
1 parent 83f73ec commit 2853b0d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
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

0 comments on commit 2853b0d

Please sign in to comment.