Around Your Ears To Get To Your Elbows (PHP External Script Architecture)

So here’s my situation.

To simplify things (ha!), i’m going to name my boxes; Athos (ubuntu), Porthos (windows 8), and Aramis (??? GIT).

I want to set up a web-GUI on Athos to run an external process (run chef’s test kitchen on a cookbook). [End Goal]
However, to do this, Athos needs the cookbook; the cookbook is in a git repository on Aramis.
Athos cannot communicate with Aramis due to networking (software protected VPN).
Athos can communicate with Porthos, who is able to communicate with Aramis because it’s on the VPN.
Athos has a fileshare with Porthos.
Aramis requires passphrase (RSA Key) authorization to access it’s git repository.

My current thought structure, convoluted as it seems is:

  1. Someone pushes button on Athos UI.
  2. Athos sends Porthos a command (either via SSH or HTTP to PHP) to git-fetch it from Aramis again (to ensure the latest version of code).
  3. Porthos has to git-fetch and then respond to a passphrase challenge; so a simple exec() command is not going to suffice; while i would like to retrieve output from this script, it’s not strictly necessary.
  4. Porthos returns a JSON to Athos’ request, telling it whether the script was executed successfully.
  5. Athos then should be able to run all necessary commands locally (4-6 exec() calls) to complete the test.

I feel like i’m overcomplicating step 3 though…is there a simpler (or at this point… a working, as the script doesnt work) way to do it?

Have you looked at the github API? https://developer.github.com/v3/

You might be able to skip a few steps