Reputation: 8595
Is there way to run a command in capistrano without adding it to a Capfile?
example:
cap --eval "run 'du -sh'" --role web
Upvotes: 8
Views: 3649
Reputation: 20867
You can use this to run a command on the servers.
cap ROLES=web invoke COMMAND='du -sh'
If you don't even have a cap recipe, you can specify the servers on the command-line:
cap -s user=myusername HOSTS=server1.com,server2.com invoke COMMAND='du -sh'
To see more command-line options, run cap -H
and cap -e invoke
.
Upvotes: 10
Reputation: 176412
You can use the (experimental) Capistrano shell.
$ cap shell
Upvotes: 5