Run Script

The Run Script action block enables you to run a bash script on your edge device.

You might have several reasons to use the Run Script action block, such as preparing the edge devices for installing a new software version or doing some special tasks after a version has been received. You may also have scripts that help to resolve issues in a software version that is running on the device.

Exit codes are utilized to confirm the successful execution of a script and ensure that the procedure completed without encountering any errors.

Example: Update Binaries on Device

Action Blocks (in order)
Task

Run Command

Copy and save device-specific configuration files

Download Artifacts

Pull your update binaries from Artifactory

Run Command

Unzip file with your binary artifacts

Run Command

Change user permissions for your application

Run Script

Verifies configuration and runs tests. Parameters: Expected exit code: 0 If failed, rollback entire update (i.e., runs general rollback)

Run Command

Restart service that runs your application

Prerequisites

  • JFrog Connect account and at least one device registered.

  • A script file ready for deployment.

Drag the Action Block

To include the Run Script action block in your update flow, do the following:

  1. Go to Deployment in the left menu and click Create Update Flow.

  2. Drag the Run Script action block and drop it in the workflow.

Configure the Action Block

Click the action block to open and configure it.

  1. Enter a name for the action block.

  2. Enter (drag and drop or browse) the script file in the script box.

  1. If you want to use any of the features below, click Advanced:

    • Expected Exit Code: Enter an exit code if you have one.

    • Enter Path to Binary: Enter the path on the device where the script should run.

    • Script Arguments: Fill in any values required for script arguments.

  1. Configure your On Failure policy and instructions for rolling back, if necessary.

  2. Save your action block configuration.

You can run additional blocks in the workflow.

What’s Next?

Learn how to deliver one or more files to your client devices using the Deploy Files action block.

Last updated