You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The balena CLI is great for CI/CD pipelines to post new releases to open-balena or balena-cloud, but it seems to be lacking some required options to be able to automate the cleanup of old releases. The specific things that would be useful are:
Fleets/applications that should be running a release - Ideally this would be an option on the releases command, such as balena releases myorg/myfleet --include-fleet-use -j. Alternatively, this could either be a new option on the apps command, such as balena apps --on-release 1030.
Devices that should be running a release - Ideally this would be an option on the releases command, such as balena releases myorg/myfleet --include-device-use -j. Alternatively, this could either be a new option on the devices command, such as balena devices should-be-running 1030.
Devices that ARE running a release - Ideally this would be an option on the releases command, such as balena releases myorg/myfleet --include-device-use -j. Alternatively, this could either be a new option on the devices command, such as balena devices is-running 1030.
Filter by release age - this could simply be an option on the balena releases command, perhaps something like -minimum-age 10 to get everything over 10 days old. That said, this one is not super important since both the text form and the json form of the releases command gives easily parseable dates, but when there are hundreds or thousands of releases, this could reduce response size.
Actual Behavior
None of the above are available.
Steps to Reproduce the Problem
Try to use the balena CLI to figure out what release are, or should be, running on fleets or devices in order to produce a list of releases over 10 days old that are not deployed to any devices or fleets.
Additional References
The current workaround we are using is to make direct API queries using the contents of the token file that is produced after balena login succeeds. This works, but it would be really nice to have this in the CLI.
For anyone else looking to do the same, this is the current query we run to get the list of releases with is running/should be running info so that we can make cleanup decisions: curl -H "Authorization: Bearer $(cat ./token)" 'https://api.balena-cloud.com/v6/release?$orderby=created_at%20desc&$select=id,status,commit,source,created_at,start_timestamp,update_timestamp,end_timestamp,raw_version,is_invalidated,is_final&$expand=is_running_on__device/$count,should_be_running_on__application($select=id),should_be_running_on__device($select=id)'
The text was updated successfully, but these errors were encountered:
Expected Behavior
The balena CLI is great for CI/CD pipelines to post new releases to open-balena or balena-cloud, but it seems to be lacking some required options to be able to automate the cleanup of old releases. The specific things that would be useful are:
Fleets/applications that should be running a release - Ideally this would be an option on the
releases
command, such asbalena releases myorg/myfleet --include-fleet-use -j
. Alternatively, this could either be a new option on theapps
command, such asbalena apps --on-release 1030
.Devices that should be running a release - Ideally this would be an option on the
releases
command, such asbalena releases myorg/myfleet --include-device-use -j
. Alternatively, this could either be a new option on thedevices
command, such asbalena devices should-be-running 1030
.Devices that ARE running a release - Ideally this would be an option on the
releases
command, such asbalena releases myorg/myfleet --include-device-use -j
. Alternatively, this could either be a new option on thedevices
command, such asbalena devices is-running 1030
.Filter by release age - this could simply be an option on the
balena releases
command, perhaps something like-minimum-age 10
to get everything over 10 days old. That said, this one is not super important since both the text form and the json form of thereleases
command gives easily parseable dates, but when there are hundreds or thousands of releases, this could reduce response size.Actual Behavior
None of the above are available.
Steps to Reproduce the Problem
Try to use the balena CLI to figure out what release are, or should be, running on fleets or devices in order to produce a list of releases over 10 days old that are not deployed to any devices or fleets.
Additional References
The current workaround we are using is to make direct API queries using the contents of the
token
file that is produced afterbalena login
succeeds. This works, but it would be really nice to have this in the CLI.For anyone else looking to do the same, this is the current query we run to get the list of releases with is running/should be running info so that we can make cleanup decisions:
curl -H "Authorization: Bearer $(cat ./token)" 'https://api.balena-cloud.com/v6/release?$orderby=created_at%20desc&$select=id,status,commit,source,created_at,start_timestamp,update_timestamp,end_timestamp,raw_version,is_invalidated,is_final&$expand=is_running_on__device/$count,should_be_running_on__application($select=id),should_be_running_on__device($select=id)'
The text was updated successfully, but these errors were encountered: