Deployments
Creating
Deployments associate firmware images to devices. NervesHub won't send firmware to a device until you create a deployment. First find the UUID of the firmware. You can list the firmware on NervesHub by calling:
In this example we will create a new deployment for our test group using firmware 1cbecdbb-aa7d-5aee-4ba2-864d518417df
.
Here we create a new deployment called qa_deployment
. In the conditions of this deployment we left the version condition
unspecified and the tags
set to only qa
. This means that in order for a device to qualify for an update, it needs to have at least the tags [qa]
and the device can be coming from any version.
At this point we can try to update the connected device.
Start by bumping the application version number from 0.1.0
to 0.1.1
. Then, create new firmware:
We can publish, sign, and deploy firmware in a single command now.
Conditionally applying updates
It's not always appropriate to apply a firmware update immediately. Custom logic can be added to the device by implementing the NervesHubLink.Client
behaviour and telling the NervesHubLink OTP application about it.
Here's an example implementation:
To have NervesHubLink invoke it, update your config.exs
as follows:
Last updated