Replies: 2 comments 1 reply
-
This is by design. You marked same task with two different label. I think Deployer can show an error in this case. Note: group tasks are ephemeral, and select filters are just passed to underlying tasks. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Sounds similar to #3141 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Migrated from issue #3698
Deployer Version
v7.3.1
Target OS
macOS Ventura 13.5.2
Which PHP version are you using?
PHP 8.2
Content of deploy.php or deploy.yaml
Steps to reproduce
We were trying to build a 2-step deployment with a build step on a local host for the CI. So first we wanted to set up the build environment, perform the build, then prepare the server and then transfer everything with the rsync recipe.
Everything worked wonderfully when the tasks were run one at a time.
In the end, we put everything together under one
deploy
group task. We ran the task if performed most tasks on both hosts at the same time, even though it should only do the CI first and the server later.With some tinkering, we found the issue.
The tasks that should be run only on one of the hosts are extended with
->select()
. This generally works.However, like it is mentioned in the docs for the CLI regarding the execution plan, all tasks are merged: https://deployer.org/docs/7.x/cli#execution-plan:~:text=Before%20executing%20tasks%2C%20Deployer%20needs%20to%20flatten%20the%20task%20tree%20and%20decide%20in%20which%20order%20it%20will%20be%20executing%20tasks%20on%20which%20hosts.
The result is, that all tasks are run on both hosts even though restrictions are in place, as long as the same task is also defined for another hosts later.
Only tasks that are defined for only one host will only run on that host.
For example, if we run
deployer:prepare
as part of thebuild
task only on the CI host, it will also run on the remote host, as the task is defined in another group task later on for the deploy.The task
npm:install
is only defined for the CI host and will not run on the remote host.Our understanding is, that the execution plan is not checking when a task should be run on a specific host. It just checks if that task will be run on any host at any time. And then it will run it on all hosts it is defined for at all times when it is called.
Beta Was this translation helpful? Give feedback.
All reactions