How to run a command on an app and get the exit code on cloudfoundry
I assume you mean get the result from outside of CloudFoundry (i.e. not one app launching another app and getting result, stdout and stderr).
You can only access CloudFoundry apps over http(s), so you would have to find a way to wrap your invocation into something that exposes everything you need as http.
We need to run arbitrary commands on cloudfoundry. (The deployed apps are Python/Django, but the language for this solution does not matter). Ideally over ssh, but the protocol does not matter.
We need a reliable way to get the exit code of the command that was run, as well as its stderr and stdout. If possible, the command running should be synchronous (as in, blocks the client until the command finished on the cloudfoundry app).
Is there a solution out there that allows us to do this, or what would be a good way to approach this issue?