Skip to main content
A deployment group connects firmware to the devices that should run it. It holds matching conditions, which decide the devices that join it, and a sequence of releases, each sending one firmware. A device belongs to at most one deployment group.
The web UI calls these deployment groups. The REST API and the nh CLI use deployment and deployments in their paths and command names. They are the same object.

Create a group and turn it on

1

Upload firmware

A group is created with its first firmware. Upload one if you have not already. --key names the signing key to sign it with:
Without --key, --key-file or --skip-signing, the upload fails. See Firmware.The command prints the version and UUID of the uploaded firmware. To find the UUID of firmware that is already uploaded, run:
2

Create the deployment group

In the web UI, open Deployment groups and select New deployment group. The form asks for Name, Delta updates, Notes, Platform, Architecture, Firmware, Tag(s) distributed to, Tag matching and Version requirement.A new group is off. No device receives firmware from it until you turn it on.
3

Turn the group on

In the web UI, open the group and select Resume. The same button reads Pause while the group is on.
4

Check the group

nh deployment list shows each group’s name, state, device count, version condition and firmware UUID. nh deployment show adds the release count, tag conditions, tag operator, archive, current release number and notes.In the web UI the group page has Overview, Releases, Stats, Activity and Settings tabs. The badge beside the group’s name shows its status: Paused, No devices, Rolling out, Up to date, Awaiting approval or Stopped. The last two only appear when the group has a workflow.

Read the group page

Overview tab

The Overview tab shows how the current release is going:
  • Rollout. How many of the group’s devices are on the release’s firmware, with a bar and a legend: On the release, Updating, Failed, and Waiting. A group with a workflow lists its steps below the bar. A group without one reads “No steps. Every device that matches gets the release the next time it connects.”
  • Devices this release didn’t reach. The devices that do not have the release and are not getting it or waiting for their step, each with what happened.
  • Current release. The release’s Firmware, Archive, Delta updates state, and who released it and when.
  • Device matching. The group’s tags and version condition. If devices outside the group match its conditions, or devices in the group no longer match, this section says how many and offers to move them in or remove them. See Put a device in a group by hand.
When the group is paused, or a workflow step is waiting for approval or has stopped, a notice at the top of the tab says so and carries the buttons to act on it.

Stats tab

The Stats tab shows how the group’s releases went. It opens on the current release. A select switches to another release or to all of them. With all releases selected, the tab shows the same four figures across every release and a Releases table. On an instance without ClickHouse, the sections that need it read “This server doesn’t keep update outcomes.” See ClickHouse.

How devices join a group

A device that is in no deployment group joins one when it connects. NervesHub looks for groups in the device’s product that:
  • are turned on,
  • do not have Lock membership on,
  • have a current release whose firmware platform and architecture match the firmware the device is running,
  • have tag conditions the device’s tags meet, and
  • have a version condition the device’s firmware version meets.
If several groups match, the device joins the one whose current release has the highest firmware version. If those are equal, it joins the group that shares the most tags with it, and then the oldest group.

Put a device in a group by hand

The CLI and the API cannot set a device’s group. In the web UI you can, with a role that holds the device:set-deployment-group permission:
  • One device. Open the device. In the Firmware updates card on the Details tab, the Deployment group row has a select that lists the groups whose platform and architecture match the device. Choose one and click Assign. When the device is in a group, the row shows the group’s name and Remove… instead.
  • Many devices. On the product’s Devices page, select the devices and use the Deployment group bulk action. See Bulk actions.
  • Every device that matches a group. When devices outside a group match its conditions, the Device matching section of the group’s Overview tab says how many and offers Move them in.
A device you place by hand does not have to meet the group’s tag conditions. It is still checked each time it connects. See When devices leave a group.

Tags

Tags are strings you assign to devices, such as main, qa or region-us-east. A group lists zero or more tags and a tag operator: A group with no tags matches devices whatever their tags. Tags are only compared when a device connects. If you tag a device that is connected and in no group, it joins a matching group the next time it connects. To make that happen now, run nh device reconnect <identifier>. A device that is already in a group stays in it whatever tags you give it.

Version condition

The version condition is an Elixir version requirement, such as >= 1.0.0, ~> 1.2 or < 2.0.0, checked against the firmware version the device is running. Leave it empty to match any version.

Platform and architecture

A group records the platform and architecture of the firmware it was created with. The group’s Settings tab shows them as Firmware for. Create one group per platform and architecture.

When devices leave a group

A device that is already in a group is checked each time it connects. It leaves the group if its firmware no longer meets the group’s version condition, platform or architecture. Changing a group’s tags does not remove devices that are already in it. Lock membership, on the group’s Settings tab, stops both: devices only join or leave a locked group when someone moves them. See Rollout controls.

Change a group’s conditions

--tag replaces the whole tag list. --tag "" or --version "" clears the condition. Only the fields you pass are changed. In the web UI, edit the Device matching card on the group’s Settings tab.

Ship a new release

To send new firmware to an existing group, create a release:
The new release becomes the group’s current release. In the web UI, select New release on the group page. Releases can also carry an archive, a description, notes and connecting code, and can be marked required. See Releases.
A deployment group does not finish. It stays on and keeps sending its current release to devices that join later.

Upload and release in one command

nh firmware upload can create a release in an existing group as soon as the upload succeeds:
Repeat --deploy to update several groups. When the flag is not given, nh uses the NERVES_HUB_DEPLOYMENT_NAME environment variable if it is set. --deploy does not create a group and does not turn one on. If creating the release fails, the firmware stays uploaded and the error names the group that was not updated. See CI/CD.

Pause a group

In the web UI, select Pause on the group page. A paused group stops sending its release, even to devices that connect, until you resume it. Devices that are already taking the update finish it. Pausing does not roll back devices that already have the firmware.

Delete a group

nh asks you to confirm. Pass --yes to skip the prompt. In the web UI, use Delete group at the bottom of the Settings tab. Deleting a group deletes its releases. Its devices leave it and join another group they match when they next connect.