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
Copy file name to clipboardExpand all lines: README.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ If you have any questions about this masterclass as you proceed through it, or w
27
27
It is assumed that the reader has access to the following:
28
28
29
29
- A locally cloned copy of this repository [Balena CLI Advanced Masterclass](https://github.com/balena-io/balena-cli-advanced-masterclass) using either `git clone https://github.com/balena-io/balena-cli-advanced-masterclass.git` or by downloading the ZIP file (from 'Code'->'Download ZIP') and then unzipping it to a suitable directory
30
-
- A balena supported device, such as a [Raspberry Pi 3B+](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) or an [Intel NUC](https://www.intel.co.uk/content/www/uk/en/products/boards-kits/nuc.html). If you don't have a device, you can emulate an Intel NUC by installing VirtualBox and following [this guide](https://www.balena.io/blog/no-hardware-use-virtualbox/). In this guide, we'll be using a Raspberry Pi 4 device.
30
+
- A balena supported device, such as a [Raspberry Pi 5](https://www.raspberrypi.org/products/raspberry-pi-5/) or an [Intel NUC](https://www.intel.co.uk/content/www/uk/en/products/boards-kits/nuc.html). If you don't have a device, you can emulate an Intel NUC by installing VirtualBox and following [this guide](https://www.balena.io/blog/no-hardware-use-virtualbox/). In this guide, we'll be using a Raspberry Pi 4 device.
31
31
- A suitable text editor for developing code on your development platform (e.g. [Visual Code](https://code.visualstudio.com/))
32
32
- A suitable shell environment for command execution (such as `bash` or `zsh`)
33
33
- A [balenaCloud](https://dashboard.balena-cloud.com/signup) account and a [balenaCloud staging](https://dashboard.balena-staging.com/signup) account
@@ -99,7 +99,7 @@ balenaUrl: 'balena-staging.com'
99
99
Now try listing the fleets from the staging environment again:
100
100
101
101
```shell
102
-
$ balena fleets
102
+
$ balena fleet list
103
103
Id App name Slug Device type Device count Online devices
@@ -299,11 +299,11 @@ For a device running a development image, you can use `balena leave` and `balena
299
299
300
300
First, provision a device using a development image. You can do this using the balenaCloud dashboard's 'Add Device' downloading a 'Development' edition image from the `cliFleet` Fleet page. Provision your device with this image using either [balenaEtcher](https://www.balena.io/etcher/) or the [balena CLI].
301
301
302
-
Once the device is provisioned and has connected to the balena network, discover its hostname or IP address by using `balena devices`:
302
+
Once the device is provisioned and has connected to the balena network, discover its hostname or IP address by using `balena device list`:
303
303
304
304
```shell
305
305
$ cd~/balenaProduction
306
-
$ balena devices
306
+
$ balena device list
307
307
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
@@ -525,7 +525,7 @@ Note that you _must_ supply the device type, although the drive to write to is o
525
525
Once provisioned, safely remove the SD card from you machine, insert it into your device and power it on. Shortly afterwards, it will connect to balenaCloud:
526
526
527
527
```shell
528
-
$ balena devices
528
+
$ balena device list
529
529
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
Once built and pushed to the device, you should see the following logs:
606
606
607
607
```shell
608
-
$ balena logs 0b9df5c
608
+
$ balena device logs 0b9df5c
609
609
[Logs] [11/11/2022, 10:38:35 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
610
610
[Logs] [11/11/2022, 10:38:35 AM] Installed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
611
611
[Logs] [11/11/2022, 10:38:35 AM] Starting service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -624,10 +624,10 @@ As you can see in `helloworld.js`, it looks like if we set the `LOG_DEBUG` envir
624
624
$ balena env add LOG_DEBUG true --fleet cliFleet
625
625
```
626
626
627
-
Now go to the dashboard for the `cliFleet` Fleet, and select'variables'.'Add' a new variable, called `DASH_VAR` and set it to `from-dash`. To verify we've now set our variables, let's use `balena envs` which will show all the environment variables setfor our Fleet:
627
+
Now go to the dashboard for the `cliFleet` Fleet, and select'variables'.'Add' a new variable, called `DASH_VAR` and set it to `from-dash`. To verify we've now set our variables, let's use `balena env list` which will show all the environment variables setfor our Fleet:
628
628
629
629
```shell
630
-
$ balena envs --fleet cliFleet
630
+
$ balena env list --fleet cliFleet
631
631
ID NAME VALUE FLEET SERVICE
632
632
676489 DASH_VAR from-dash ryanh/clifleet *
633
633
676488 LOG_DEBUG true ryanh/clifleet *
@@ -636,7 +636,7 @@ ID NAME VALUE FLEET SERVICE
636
636
As you can see, both variables now show up in our list. However, if we now list the logs for the device, we'll see something else:
637
637
638
638
```shell
639
-
$ balena logs 0b9df5c
639
+
$ balena device logs 0b9df5c
640
640
[Logs] [11/11/2022, 10:41:39 AM] Killed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
641
641
[Logs] [11/11/2022, 10:41:40 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
642
642
[Logs] [11/11/2022, 10:41:41 AM] Installed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -654,7 +654,7 @@ When we set the environment variable, the Supervisor on the device noted that th
654
654
655
655
```shell
656
656
$ balena env rm 676488 --yes
657
-
$ balena envs --fleet cliFleet
657
+
$ balena env list --fleet cliFleet
658
658
ID NAME VALUE FLEET SERVICE
659
659
676489 DASH_VAR from-dash ryanh/clifleet *
660
660
```
@@ -664,7 +664,7 @@ Note that we used the `--yes` switch to force the deletion of the variable. With
664
664
Wait a little while to let the Supervisor see that the environment variable has been deleted, and then look at the logs again:
665
665
666
666
```shell
667
-
$ balena logs 0b9df5c
667
+
$ balena device logs 0b9df5c
668
668
[Logs] [11/11/2022, 10:45:07 AM] Service exited 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
669
669
[Logs] [11/11/2022, 10:45:07 AM] Killed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
670
670
[Logs] [11/11/2022, 10:45:08 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -722,7 +722,7 @@ If we hadn't specified the `latest` commit, we'd have been given an interactive
722
722
723
723
Now provision your device using the resulting image using `balena os initialize` or balenaEtcher. Once booted look at the logs for that device and notice that no download ocurred, and the Supervisor immediately started the preloaded application.
724
724
725
-
`balena preload` has a wealth of switches, and can modify the device significantly. It's well worth familiarizing yourself with the options [here](https://github.com/balena-io/balena-cli/blob/master/docs/balena-cli.md#preload).
725
+
`balena preload` has a wealth of switches, and can modify the device significantly. It's well worth familiarizing yourself with the options [here](https://docs.balena.io/reference/balena-cli/latest/#preload).
726
726
727
727
#### 5.2 Preregistering a Device
728
728
@@ -733,7 +733,7 @@ We'll generate a unique key for the device first, which we'll then use to modify
733
733
We'll verify that we're registering a device by first listing the devices currently associated with the `cliFleet` Fleet:
734
734
735
735
```shell
736
-
$ balena devices --fleet cliFleet
736
+
$ balena device list --fleet cliFleet
737
737
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
0 commit comments