-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Run function does not run functions from the deploy_path #381
Comments
all command run using |
This also happens when a command is run through a hook (after); after('elgentos:test', 'elgentos:test2'); Both test and test2 commands have one line; writeln(run('pwd')); ➜ project git:(master) ✗ dep elgentos:test staging
➤ Executing task elgentos:test
/home/elgentos/project
✔ Ok
➤ Executing task elgentos:test_next
/home/elgentos
✔ Ok The suggestion by @ad3n does not work when the commands are not run in the deploy context, because at that point the {{release_path}} variable isn't set and an error is thrown. Right now I'm left with two options; within('{{deploy_path}}', function () use ($all, $my, $args) { run('whatever ' . $all . $my . $args); }); or run('cd {{deploy_path}} && whatever ' . $all . $my . $args); Both of which aren't elegant. So I vote for this issue to be re-opened @Elfet |
Will look close on it. |
There was bug with task('...', function () {
cd('{{deploy_path}}');
run('pwd');
}); |
Or use short syntax: task('hook', '
cd {{deploy_path}};
pwd;
'); |
👁 17dcad7 |
This is a 🤦♂️ kind of behavior: every task now needs to I've tried Usually project is residing in a single folder that is not user home directory and it makes sense to Even if you don't want to change the default behavior it would be awesome if you would provide some workaround like optional setting Thank you. |
Maybe this will go to v5 (it still in beta). I don't like to cding to release path too. But i think what task should be without side effects as possible (cd in one mustn't effect working_path in another one)
Try this: set('working_path', '{{release_path}}'); If you can add this to docs (and more stuff what you this necessary about cding) will be really cool. |
Working path didn't work :( https://github.com/deployphp/deployer/blob/master/src/Task/Task.php#L87 |
Yeah, this should be fixed. |
In the documentation it says
Runs a command on a remote server in the working path (server(...)->env('deploy_path', '/home/path')).
But when I run 'pwd', I found the working path was the home directory of the user. Either there is a bug or the documentation is wrong?
The text was updated successfully, but these errors were encountered: