Run Command
The Run Command action block enables you to run a bash command on your client device.
The Run Command action block is useful for performing a variety of actions on the edge device. You may need the Run Command as a prerequisite to other action blocks, 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 action blocks, 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 block, you may use Run Command along with other action blocks. A customer example below illustrates how you might use the Run Command action block in an update workflow.
Example: Run Command in Update Workflow
Action Blocks (in order) | Task |
---|---|
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 block cannot be reverted. Therefore, for pulling artifacts, we recommend using one of the pull action blocks such as Artifacts, Deploy Container or Clone Git Repository.
Prerequisites
JFrog Connect account and at least one device registered.
Drag the Action Block
Go to Deployment in the left menu and click Create Update Flow.
Drag the Run Command action block and drop it in the workflow.
Configure the Action Block
Click the action block to open and configure it.
Enter a name for the action block.
Enter the full bash command to run, including the values of any parameters required.
If you want to enter an expected exit code, click Advanced and enter the code.
Configure your On Failure policy and instructions for rolling back, if necessary.
Save your action block configuration.
You can run additional commands in the update workflow by adding more action blocks. You can also perform other actions in the same workflow just by adding and configuring the relevant action blocks.
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 block.
What’s Next?
Learn more about using the Run Script action block to run a script on your client devices.
Last updated