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
Independently of having an autoupdate feature (#1669), there are use cases of dynamically generating a download link to the latest CLI executable installer or zip package, for use in web pages or scripts (curl / wget command lines), including users' CI scripts.
The recommended way to deploy code is to install the balena CLI. The easiest way to do this is to use the installer for your OS available on the releases page. Choose the latest release of the installer for your OS, and follow the installation instructions. Note: You may also install the balena CLI via npm on a system running NodeJS, as explained in NPM Installation.
There are 4 links to the CLI documentation/releases above. Considering the document is a getting started guide for first-time users, it would be desirable to replace the 4 links with 1 or 2 links, one of them being a direct link to an .exe or .pkg file for Windows / macOS respectively. Something like:
For this to be possible, the docs / getting started guide would need to dynamically generate the download link to the latest available CLI release, for the required platform.
So we need a couple of things on the CLI side:
Some reference Javascript code, ideally executable on a web page (not just Node.js), that generates a download link to the latest CLI executable installer or zip package.
A CLI command that does the same: balena update
This may be doable via some GitHub or npm registry HTTP API (hopefully public, non authenticated) that fetches available releases, otherwise we might need to publish/store CLI release information somewhere (like the balenaCloud API, but consider also users of openBalena and even standalone balenaOS images, which are configurable using the CLI, who are in principle not required to have a balenaCloud user account).
Regarding the balena update command, it was discussed before in CLI check-ins (Shaun). The command's purpose is to manually initiate a CLI update, not generate download URLs. However, it may be reasonable (?) to introduce the URL generation functionality first. For example:
$ balena update print-url --platform windows --type executable
https://github.com/balena-io/balena-cli/releases/download/v11.30.17/balena-cli-v11.30.17-windows-x64-installer.exe
$ balena update print-url --platform macos --type executable --version 11.30.10
https://github.com/balena-io/balena-cli/releases/download/v11.30.10/balena-cli-v11.30.10-macOS-x64-installer.pkg
$ balena update print-url --platform linux --type standalone
https://github.com/balena-io/balena-cli/releases/download/v11.30.17/balena-cli-v11.30.17-linux-x64-standalone.zip
$ balena update print-url --type source-zip
https://github.com/balena-io/balena-cli/archive/v11.30.17.zip
$ balena update
→ Causes `balena help update` to be printed, including an explanation like:
The `balena update` command is intended to check for available CLI releases and
initiate an update installation. At the moment, only the `print-url` subcommand
is implemented. It can be used to print URLs to CLI installers for use in your
own scripts.
The description of the balena update print-url subcommand above is just an idea I've had. It would be good to discuss it a bit more widely (Scott, Shaun, Cameron, Thodoris, Page...) before starting the implementation.
The text was updated successfully, but these errors were encountered:
Independently of having an autoupdate feature (#1669), there are use cases of dynamically generating a download link to the latest CLI executable installer or zip package, for use in web pages or scripts (
curl
/wget
command lines), including users' CI scripts.For example, the getting started guide / reference docs include several links to the CLI installation instructions or the releases page:
There are 4 links to the CLI documentation/releases above. Considering the document is a getting started guide for first-time users, it would be desirable to replace the 4 links with 1 or 2 links, one of them being a direct link to an
.exe
or.pkg
file for Windows / macOS respectively. Something like:(More about this in issue #1711.)
For this to be possible, the docs / getting started guide would need to dynamically generate the download link to the latest available CLI release, for the required platform.
So we need a couple of things on the CLI side:
balena update
This may be doable via some GitHub or
npm
registry HTTP API (hopefully public, non authenticated) that fetches available releases, otherwise we might need to publish/store CLI release information somewhere (like the balenaCloud API, but consider also users of openBalena and even standalone balenaOS images, which are configurable using the CLI, who are in principle not required to have a balenaCloud user account).Regarding the
balena update
command, it was discussed before in CLI check-ins (Shaun). The command's purpose is to manually initiate a CLI update, not generate download URLs. However, it may be reasonable (?) to introduce the URL generation functionality first. For example:The description of the
balena update print-url
subcommand above is just an idea I've had. It would be good to discuss it a bit more widely (Scott, Shaun, Cameron, Thodoris, Page...) before starting the implementation.The text was updated successfully, but these errors were encountered: