I trying to create an automatic Forge deployment script which does the following:
I'm using https://github.com/laravel/forge-sdk because it's got useful timeout and wait functions.
At point 4 installing Git repository it fails, after about 2 minutes (which is also my timeout).
None of the scripts needed either wait or timeouts but the Git one is proving really problematic.
The error appears to indicate an issue with the default index.php file that is created with every new forge site:
Cloning into 'test113.domain'... Warning: Permanently added the RSA host key for IP address 'a.b.c.d' to the list of known hosts. error: Untracked working tree file 'public/index.php' would be overwritten by merge. fatal: unable to checkout working tree warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
Strangely from my localhost to the Forge server this doesn't fail, but from the Forge server to the Forge server I get this issue.
Here is the line that fails:
$result = $this->api->setTimeout(120)->installGitRepositoryOnSite($this->client['server_id'], $siteId, json_decode($payload, 1), true);
If I could get rid of the default phpinfo
index.php file that could possibly help?
Any clues how to do this? Or advice on automated Github deployment using Forge?