Run Script

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

You might have several reasons to use the Run Script action, 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

Actions (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

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

To include the Run Script action 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 and drop it in the workflow.

Configure the Action

Click the action to open and configure it.

  1. Enter a name for the action.

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

  1. Enter the following:

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

    • Script Arguments: The values required for script arguments.

    • Expected Exit Code: Success is usually 0 in Linux shell systems, but it could be different depending on the specific command or script.

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

  2. Save your action configuration.

You can run additional actions in the workflow.

What’s Next?

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

Last updated