Hi,
we use balenaOS to distribute our SW to devices remotely.
And we use ENV variables that define the necessary switches per device or installation.
We use production (not developement) images.
Now my question: How can I easily copy/paste ENV variables from one device to another ?
I thought of using balena push <fleet_name> --env my_env=my_env_value. But this does not seem to work. Any other ideas ?
I also saw that there is a balena push <flee_id>.local --env my_env=my_env_value - however that only works for a development image (not production like we work with).
Hi,
Do you need the ENV variables at build-time or at run-time? If it is the latter, you can use a balenaCloud runtime variables, as reference here in our documentation. Let me know if this answers your question!
We use ENV variables at run-time. And I do already use balenaCloud runtime-variables as you reference.
And exactly those I would like too copy paste to another device ! (or fleet if its fleet-variables).
I can only copy them by entering one by one manually into the next device. But what I would like much rather is to export an ENV-set and to import the entire set to the next device (or fleet if its fleet-variables). Can you do that ?
do you think using balena-cli, see env vars here: balena CLI Documentation - Balena Documentation
would be helpful?
You can easily create a reusable script to read the ENV vars from a device and to add them to another.