Skip to main content
Documentation

Retain and Clean Up Versions

Keep releases permanently and delete routine builds, such as nightly builds, automatically. Nexigon offers four tools for this:

  • Marking a version as a release protects it from deletion until you remove the mark.
  • Sealing permanently protects a completed version from changes and deletion.
  • A retention policy of a package deletes other versions beyond a maximum count or age.
  • A deletion deadline deletes one version at a given time.

Deleting a version removes it with all its tags. Its files stay in storage until unused-asset cleanup removes the ones that no other version uses.

You need Nexigon CLI with permission to manage the package’s versions. The examples use the firmware/controller package.

The Nexigon CLI commands assume an organization API token. With a user token, add --organization <org-id> to each command, as Organization Selection describes.

Mark a Release

Mark a version that you distribute as a release, so that Nexigon Hub keeps it:

nexigon-cli repositories versions mark-release <version-id>

In Nexigon Hub, open the version and choose More options → Mark as Release instead. A release appears on the package’s Releases page, cannot be deleted, and does not count toward retention limits. Marking a version as a release also cancels its deletion deadline.

Unlike sealing, the mark can be removed with repositories versions unmark-release or More options → Remove Release Status. The version is then subject to the retention policy again.

A release’s files and metadata remain editable. To also protect them, seal the release.

Seal a Version

Seal a version once its files and metadata are complete:

nexigon-cli repositories versions seal <version-id>

Sealing cannot be undone. A sealed version keeps its files and metadata, cannot be deleted, and does not count toward retention limits. Sealing also cancels a deletion deadline. Tags can still be added and moved.

Set a Retention Policy

Keep at most 100 versions and delete versions older than 30 days, except for the protected versions described below:

nexigon-cli repositories packages set-retention firmware/controller \
  --max-versions 100 --max-age-days 30

A version is deleted when it exceeds either limit; supply only one option to use a single limit. The policy never deletes sealed versions, versions marked as releases, base versions of other versions, and system versions that devices report as running through their system update integration. These versions do not count toward the limits. Seal or mark the releases that you must keep, including app releases, before you enable a policy that could delete them.

The command replaces the previous policy, and the next cleanup, normally within five minutes, applies it to existing versions. --disable turns the policy off; deletion deadlines of individual versions still apply. repositories packages info shows the current policy. Version Retention describes the rules in detail.

Schedule the Deletion of a Build

Give a build a deadline when you create it, for example in a nightly CI job:

nexigon-cli repositories versions create firmware/controller \
  --name nightly --tag nightly,reassign --delete-after 7d

--delete-at sets a fixed time instead. The deadline is part of the creation, so a rejected deadline creates no version. To change the deadline of an existing version later, use its version ID. A tag such as nightly might refer to a different build by then:

# Delete 14 days from now.
nexigon-cli repositories versions schedule-deletion <version-id> --delete-after 14d

# Delete at a fixed time.
nexigon-cli repositories versions schedule-deletion <version-id> --at 2027-01-31T00:00:00Z

# Cancel the deadline. A retention policy still applies.
nexigon-cli repositories versions schedule-deletion <version-id> --cancel

Durations use seconds (s), minutes (m), hours (h), days (d), and weeks (w), also combined, such as 2h30m. Days have 24 hours. Nexigon CLI computes the deadline from its own clock, so a new duration counts from now, not from the previous deadline. A fixed time needs a time zone. Scheduled Deletion describes how Nexigon Hub applies deadlines.