Run a specific remote task from the current project.
$ tomo run [--dry-run] [options] [--] TASK [ARGS...]
Remotely run one specified TASK, optionally passing ARGS to that task. For example, if this project uses the rails plugin, you could run:
$ tomo run -- rails:console --sandbox
This will run the rails:console task on the host specified in
.tomo/config.rb configuration file, and will pass the
--sandbox argument to that task. The
-- is used to separate tomo options from options that are passed to the task. If a task does not accept options, the
-- can be omitted, like this:
$ tomo run core:clean_releases
When you specify a task name, the
run command is implied and can be omitted, so this works as well:
$ tomo core:clean_releases
You can run any task defined by plugins loaded by the plugin declarations in
.tomo/config.rb. To see a list of available tasks, run the tasks command.
run command, tomo will initialize the
:release_path setting to be equal to the current symlink (i.e.
/var/www/my-app/current). This means that the task will run within the current release.
||Run the task using a privileged user (e.g. root). This user is configured per host.|
||If the configuration contains multiple environments, specify the ENVIRONMENT that should be used (e.g. production). The host(s) and settings can be different per environment.|
||Override the setting NAME with the given VALUE. Refer to the settings overrides documentation for a detailed explanation.|
||Simulate running tasks instead of using real SSH.|
||Override the PATH where the configuration file is loaded from. (Default:
||By default, tomo automatically determines whether to use color output based on the capabilities of the terminal. Use this option to override this behavior and force tomo to enable or disable color output.|
||Enables verbose logging output that is helpful for troubleshooting. This includes runtime information such as the environment variables on the remote host and all tomo settings. Each SSH command executed by tomo is also logged in detail.|
||Normally if a tomo command fails, a concise and helpful error message is printed. If
||Prints the help for this tomo command, similar to what you see on this page.|
Given the following configuration:
plugin "puma" host "email@example.com"
Then we could run puma:restart like this:
$ tomo run puma:restart tomo run v1.1.2 → Connecting to firstname.lastname@example.org • puma:restart systemctl --user start puma_example.socket systemctl --user restart puma_example.service ✔ Ran puma:restart on email@example.com