我们在 deploy.mysite.com em>下设置了一个Laravel部署网站,用于处理部署 对于众多其他网站。 p>
我正在尝试部署的另一个网站也是Laravel网站,位于 site2.myothersite.com em>下。 p>
两者都在同一台服务器上。 部署在site2上调用脚本,此部署脚本在 通常情况下 在项目根目录中直接通过SSH运行,它运行得很好。 p>
但是当通过部署脚本(使用php 似乎 如何更改此行为? p>
div> cd code>之后运行各种命令到项目目录。 我们使用以下命令更新数据库结构。 p>
php artisan migrate --force
code> pre>
exec() code>运行时) 运行这些命令)该过程确实有效 - 但是,而不是更新我们
cd code>'的项目,它会更新部署站点的数据库结构! strong> < / p>
php artisan migrate code>命令忽略了我
cd code>'d进入另一个项目的事实并且它需要数据库 来自当前目录的值。 p>
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?