Run Command
The Run Command action enables you to run a bash command on your client device.
The Run Command action is useful for performing a variety of actions on the edge device. You may need the Run Command as a prerequisite to other actions, for example, to create folders on the devices before delivering files or to stop a service before delivering an update.
You might also use Run Command after other actions, for example, to run a script that was delivered in a previous action or to delete artifacts no longer used.
Although you could create a workflow with a single run command action, you may use Run Command along with other actions. A customer example below illustrates how you might use the Run Command action in an update workflow.
Example: Run Command in Update Workflow
Run Command
Safekeeping device-specific configuration files
Download Artifact
Pull your update binaries from Artifactory
Run Command
Unzip file with your binary artifacts
Run Command
Change user permissions for your application
Run Command
Restart service that runs your application
Pull Commands
A pull command used in the Run Command action cannot be reverted. Therefore, for pulling artifacts, we recommend using one of the pull actions such as Artifacts, Deploy Container or Clone Git Repository.
Prerequisites
JFrog Connect account and at least one device registered.
Drag the Action
Go to Deployment in the left menu and click Create Update Flow.
Drag the Run Command action and drop it in the workflow.
Configure the Action
Click the action to open and configure it.
Enter a name for the action, for example, Unzip Files.
Enter the full bash command to run, including the values of any parameters required.
Enter the expected exit code. Success is usually 0 in Linux shell systems, but it could be different depending on the specific command or script.
Configure your On Failure policy and instructions for rolling back, if necessary.
Save your action configuration.
You can run additional commands in the update workflow by adding more actions. You can also perform other actions in the same workflow just by adding and configuring the relevant actions.
If you plan to run several commands and need to specify a logic that is more complex, you might consider using the Run Script action.
What’s Next?
Learn more about using the Run Script action to run a script on your client devices.
Last updated