Best Practice Guide – Create a micro-update recipe

This guide goes over the best practice to fill and create an Over-The-Air software update to your product fleet. The best practice guidelines are taught how to fill a micro-update recipe for Linux based products while using the best technics to make the software deployment effective and successful as possible.

The micro-update recipe fill approach

This approach based on known technics where the device application runs using a service manager or by any other methodology which responsible to reload, start and stop the app software. It is recommended to use this guide to create a systemd service of your application.

Guidelines

1. Under the Micro-update category, click on ‘Create New Micro Update’ to start the process.

2. In the general details section, select the devices you would like to deploy the next update. Then, fill the micro-update version, for example: v1.1.2 and the comment row with relevant details about this update.

3. The ‘Before update’ section – used to run BASH command at the beginning of the update deployment. This section designed to be a place where you can stop your software from running and get your device’s environment ready for upcoming changes you are going to make. It is also possible to upload a BASH script instead that will run in this section.

Here are a few known examples of commands that may be suitable for this section:

Stop the application –

service MyApp stop

Stop the application, remove possible logs –

service MyApp stop;rm /home/myapp/logs/*

Kill the application –

killall -9 MyApp

4. The ‘Upload files/directories’ section – used to upload and deploy new files and directories to our devices easily. By default, if the uploaded directory or file already exists on the device file system, JFrog Connect agent will replace it with the new one. You can upload up to 200MB files size at once. This section is great for upgrading your software application files, changing current configuration files with new ones, or uploading new parts of your software.

5. The ‘Install dependencies’ section – used to remotely install packages and libraries as needed, for example: installing python packages using ‘pip’ or ‘pip3’, installing Linux packages using ‘apt-get’ and etc.

6. The ‘After update’ section – used to bring back to work our device environment and application and reboot the device if needed. For example:

service MyApp start

7. The ‘Rollback’ section, includes options and actions to do in case of the micro-update fails from any kind of reason. Checking the ‘revert uploaded files’ ensures that on failure JFrog Connect agent will rollback and place the files that were before the update.

It is also possible to run a BASH command and reboot the device in this section.

JFrog Connect is a modern Linux-first IoT platform designed to efficiently update, control and monitor edge and IoT devices at scale.