Device YAML Reference
This is the reference for the device configuration data. The configuration data is written in YAML format and the record is stored within the BeetleboxCI application in its device registry. If you are not familiar with YAML, please see this guide.
devices
Required. The devices that are defined in this config code. At present, BeetleboxCI only supports one device being stored in each record.
Key | Required | Type | Description |
---|---|---|---|
<device_name/> | Y | Map | The namne of a device. |
devices.<device_name/>
Required.
Each device must be given a unique name. <device_name/>
must start with a letter and only contain alphanumeric characters.
Key | Required | Type | Description |
---|---|---|---|
transfer | N | String | The command used to transfer files to/from the device. |
connection | Y | String | The command used to issue commands to the device. |
prompt | Y | String | The string used to monitor the terminal within the device. |
status | N | Map | Contains information for monitoring the status of the device. |
devices.<device_name/>.transfer
The command used to transfer files to/from the device.
Example
devices:
raspberry-pi:
transfer: bash -c "sshpass -p raspberry scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r $SOURCE $DESTINATION"
devices.<device_name/>.connection
Required. The command used to issue commands to the device.
Example
devices:
raspberry-pi:
connection: sshpass -p raspberry ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" pi@192.168.1.92
devices.<device_name/>.prompt
Required. The string used to monitor the terminal within the device.
Example
devices:
raspberry-pi:
prompt: "$"
devices.<device_name/>.status
Contains information for monitoring the status of the device. The status of a device is monitored by creating a runner (container) that communicates with the device and runs some simple commands to test whether or not the device responds.
Key | Required | Type | Description |
---|---|---|---|
setup | N | String | Optional field that may be used to prepare the runner to communicate with the device. |
command | Y | String | The actual command(s) that are executed on the device. |
pass | Y | String | The string that must be detected in the terminal output to confirm that the device has given the expected response. |
interval | N | String | Optional cron string that could be set to periodically check the status of the device. |
devices.<device_name/>.status.setup
Optional field that may be used to prepare the runner to communicate with the device. This would often be used to install device-specific software or drivers that are needed to communicate with the device.
Example
devices:
raspberry-pi:
status:
setup: |
apt-get install sshpass -y >/dev/null 2>&1
devices.<device_name/>.status.command
Required. The actual command(s) that are executed on the device.
Example
devices:
raspberry-pi:
status:
command:
bash -c 'echo Hello World'
devices.<device_name/>.status.pass
Required. The string that must be detected in the terminal output to confirm that the device has given the expected response.
Example
devices:
raspberry-pi:
status:
pass:
"Hello World"
devices.<device_name/>.status.interval
Optional cron string that could be set to periodically check the status of the device.
Example
devices:
raspberry-pi:
transfer: bash -c "sshpass -p raspberry scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r $SOURCE $DESTINATION"
connection: sshpass -p raspberry ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" pi@192.168.1.92
prompt: "$"
status:
interval:
0 * * * *
Reserved keywords
There are certain strings that should not be used in a BeetleboxCI config file, as these are used internally by BeetleboxCI. Using these keywords in your config file may cause errors or unpredictable behaviour. The keywords are listed in the table below:
Key |
---|
//_line//_ |