We have a Laravel deployment website set up under deploy.mysite.com which handles deployments for a multitude of other websites.
One other website I'm trying to deploy which is also a Laravel site resides under site2.myothersite.com.
Both are on the same server. Deploy calls a script on site2, this deploy script runs various commands after cd
'ing to the project directory. We use the following to update the database structure.
php artisan migrate --force
Ordinarily when this is run directly via SSH when in the project root, it runs just fine.
However when this is run via the deployment script (using php exec()
to run these commands) the process does work - however, instead of updating the project that we've cd
'd into, it updates the database structure of the deployment site!
It seems as if the php artisan migrate
command ignores the fact I've cd
'd into another project and it takes the database values from the current directory.
How can I go about changing this behaviour?