resin-release-tool
This tool is to set releases to release groups and canaries in balenaCloud
Installation
pip install resin-release-tool
Build / Run locally
You need poetry to build the project https://python-poetry.org/
poetry install
poetry build
poetry run resin-release-tool
etc..
Example usage
One canary group
Mark relevant devices with device tags with name "release_group" and value "canary" on balenaCloud.
To deploy a canary commit to them, run:
resin-release-tool --app $APP_ID release -c $CANARY_COMMIT -g canary
To deploy said commit to rest of devices, run:
resin-release-tool --app $APP_ID release -c $NEW_RELEASE_COMMIT -a
resin-release-tool --app $APP_ID unpin canary
(Note: Running the unpin command is not necessary if canary is already on NEW_RELEASE_COMMIT, however, without it, it won't track the latest app-wide release.)
Staggered release with multiple groups
Mark relevant devices with device tags with name "release_group" and value "release_group_1/2/3" on balenaCloud.
To deploy a commit to all devices in a staggered way:
(Add appropriate wait or checks between commands as appropriate for your usecase.)
resin-release-tool --app $APP_ID release -c $NEW_RELEASE_COMMIT -g release_group_1
resin-release-tool --app $APP_ID release -c $NEW_RELEASE_COMMIT -g release_group_2
resin-release-tool --app $APP_ID release -c $NEW_RELEASE_COMMIT -g release_group_3
resin-release-tool --app $APP_ID release -c $NEW_RELEASE_COMMIT -a
resin-release-tool --app $APP_ID unpin release_group_1 release_group_2 release_group_3
Usage
Usage: resin-release-tool [OPTIONS] COMMAND [ARGS]...
You can set app and token as environment variables, using RESIN_APP and
RESIN_TOKEN
Options:
--token TOKEN balenaCloud auth token [required]
--app APP_ID balenaCloud app ID [required]
--help Show this message and exit.
Commands:
disable_rolling Disables rolling releases in the application
enable_rolling Enables rolling releases in the application
info Information of the application
release Sets release commits for a given release or app
releases Show successful releases of the application
show_devices_status Show the status of the devices in the app
show_group_versions Show the release versions of the devices in release groups
unpin Unpins the version of one or more releases
Development
- The config file used by the balena_sdk is located at
$HOME/.balena/balena.cfg
To format the code run:
black <path to files >
Tests can be run with
poetry run pytests
To debug/run commands in pycharm configure resin_release_tool/cli.py as the script path and the command you want to run as parameter (credentials can be added as envs)
Publishing a new version
Pre-release steps
- upddate the changelog and run
make release <version> # e.g. v0.3.1
to update the version inpyproject.toml
Release step
- After merging these changes, tag the commit on master using
git tag <version>. This must match the new version in thepyprojct.toml - push the new tag to Github
git push origin <version>this should trigger thepublish-to-pypiworkflow
New versions are uploaded to https://pypi.org/project/resin-release-tool/
Metadata
Release files for resin-release-tool 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| resin_release_tool-0.3.2.tar.gz | 7.2 kB | Without provenance | Details for resin_release_tool-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| resin_release_tool-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for resin_release_tool-0.3.2-py3-none-any.whl |
Total release size: 15.6 kB
Release files / resin_release_tool-0.3.2.tar.gz
| Download URL | resin_release_tool-0.3.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
285879b3c756621ba3e637de499411c702b50245215121f1480a5c193391cbd6
|
|
BLAKE2b-256 checksum How to use checksums |
054ad58924868ac920192ee2121ce3297009222c5eeee3d0f0138ffba410b193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.10 Linux/5.15.0-1034-azure
|
Release files / resin_release_tool-0.3.2-py3-none-any.whl
| Download URL | resin_release_tool-0.3.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06d6a06d9d3a6632c5d6e6dd86adb0846c47ef3dbf41b39f7dd18911b08a27ba
|
|
BLAKE2b-256 checksum How to use checksums |
6a8837fb59a77405c27141549ca1836444ec3b911b09e6570d5707e543017e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.10 Linux/5.15.0-1034-azure
|
Security for resin-release-tool 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.