So today I've been running into a huge issue that I haven't encountered before.
This issue basically took down my site for many hours, naturally, I want to remedy this for the future and do things better.
The issue was that Composer was/is hanging on the "Updating dependencies" step, forever!! Like, literally 20+ minutes. Which then causes Codedeploy to timeout, and the build tool cannot catch this before as it's not a code error. Very shitty situation.
This is the whole composer.json in case you think "wtf, 20+ minutes"
"require": {
"php": ">=7.0.0",
"slim/slim": "^3.10",
"slim/twig-view": "^2.4",
"illuminate/database": "^5.6",
"vlucas/phpdotenv": "^2.4",
"symfony/console": "^4.1",
"league/container": "^2.4",
"predis/predis": "^1.1",
"slim/flash": "^0.4.0",
"robmorgan/phinx": "^0.10.5",
"illuminate/pagination": "^5.6",
"vlucas/valitron": "^1.4",
"league/flysystem-aws-s3-v3": "^1.0",
"odan/slim-csrf": "^1.0",
"intervention/image": "^2.4",
"illuminate/events": "^5.6",
"piwik/device-detector": "^3.11",
"nochso/html-compress-twig": "^2.0"
I am still unsure what causes this, as I said, I have never had this issue before.
But this got me thinking, wouldn't it be better if I do the composer install -on --no-dev --prefer-dist -d /var/www/ during the continuous deployment and then have it ready once it hits the production server.
instead of running this on production, during deployment.
Can you guys tell me if that's a good ay, and maybe give me some tips how I can achieve this / what tools for continuous deployment I could use that support this (and codedeploy).
Thanks! :)