-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{{ project_dir }} resolves to the local project directory in runLocal() #101
Comments
I have the very same need. |
Heres an easy way to get the remote project dir: $serverRepository = $this->getConfig(Option::servers);
$servers = $serverRepository->findAll();
foreach ($servers as $server) {
$remoteProjectDir = $server->get(\EasyCorp\Bundle\EasyDeployBundle\Server\Property::project_dir);
// $remoteProjectDir points to the release folder.
} |
Hi, where should we apply this code to? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In DefaultDeployer, {{ project_dir }} resolves to the local project directory when it is used inside runLocal(). This may be intended behaviour, but it makes it difficult to copy things to the release directory.
Consider the case of a public/build directory generated by Webpack Encore. I cannot install Webpack Encore on the production server, so I need to copy my public/build folder into the deployment from my local machine. So within beforeFinishingDeploy() I want to do something like:
$this->runLocal('rsync -r public/build/ me@remote:{{ project_dir }}/public/build');
But unfortunately in this case, {{ project_dir }} resolves to the local path of my project, making a nonsense command.
Could we have a {{ remote_project_dir }} available from runLocal()?
Even better, {{ remote_web_dir }}, {{ remote_bin_dir }} etc?
Perhaps you think that a sane deployment should not be copying things manually from the local machine to the server like this. But in that case I think you need to make DefaultDeployer support Webpack Encore managed assets, because this is a recommended solution now in the Symfony docs.
Thank you for considering this. I really like easy-deploy-bundle. It's a great relief not to have to use Capistrano any more.
The text was updated successfully, but these errors were encountered: