Invoke should not be used inside the on() block.

See https://github.com/capistrano/capistrano/issues/741