A simple ruby script can handle that:
each-app.rb:
#!/usr/bin/ruby
PATH = '/mnt/apps'
Dir.glob("#{PATH}/*").each do |dir|
Dir.chdir(dir)
puts "(in #{dir})"
ARGV.each { |cmd| system(cmd) }
end
This script iterates each folder under "/mnt/apps" directory, goes into that directory and executes each command.
you can run it like so:
./each-app.rb 'git pull' 'rake db:migrate'
just dont forget to
chmod +x each-app.rb
happy hacking