When deploying a Symfony2 app to Elastic Beanstalk I need to perform a manual cache clear in order for the app to begin functioning. So, I added a container command to clear the prod cache during deployment. The command runs, but I still had to manually clear in order for the app to work.
After some digging around, I found that there are absolute path strings in Symfony2 cache files themselves. The command I added runs "pre-deployment" or before the app files get moved from their staging folder (called '/var/app/ondeck') to their final resting place ('/var/app/current'). As a result, the absolute path strings in the cache files are wrong and the app fails to load.
Also, the dev environment works fine right away because it rebuilds its own cache automatically. The prod environment is the only one that is affected.
My question(s):
- Is there a way to run the cache clear command automatically AFTER the code has been moved into place?
- Alternatively, is there some way to get Symfony2 to let you specify a different "base path" for the cache generation? That way it could be set up to point to the correct final location.
Thanks everyone in advance :-)