-
Notifications
You must be signed in to change notification settings - Fork 979
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
All multi-site predeploy hooks trigger on single site deployment #1160
Comments
Hi @tooga I see in your |
@thechenky the example was a bit simplified, the predeploy script also gets additional parameters: So now, even if I want to only build and deploy one hosting site (using deploy target), it runs all of the other hosting target predeploy scripts as well, and thus creates also production builds for all of my hosting sites. This doesn't sound like expected behaviour, and I would assume that only the predeploy script defined for the specific hosting target would be run. |
Can you paste the actual command then? It's difficult to debug when I'm not seeing the real code. Please also paste your predeployment script. |
So, the full
The
Now on the project root, running |
Hi @tooga thanks for pasting those in, this is much more helpful. How are you setting |
I think that my custom predeploy scripts or build commands (and if/how they work) are not really relevant here. This is another simple
So in essence, each predeploy hook of the hosting targets is just printing a command to the CLI. Now, when I run What happens now is the following:
So as you can see, both the ADMIN and STORE predeploy hooks are run. This is not what I expect when I only want to deploy the STORE hosting target. My
|
I suspect that I probably did this with PR #1130 (because we we're running lifecycle hook on multi-resource deploys correctly to begin with) but I had thought there was already logic in place to deal with resource specific deploys. I'll take a look. |
Aha, so it seems that we currently only deal with |
Great that you found the possible issue! |
Hello, I'm running into the same issue here, is there an ETA of when the fix will be available? |
Sorry about that, for some reason I thought I had already fixed this. I just sent out a PR that should resolve it. |
Thanks @Memeriaj |
That PR was released as part of 6.7.0 so this should now be fixed if you update the CLI. I'm going to close this issue, but if it isn't working or you find another problem with it please re-open or create a new issue. |
@Memeriaj I just upgraded to |
I’m seeing this as well, but for {
"hosting": [
{
"target": "production",
"public": "public",
"postdeploy": "echo \"Just deployed My Project to production environment.\""
},
{
"target": "staging",
"public": "public",
"postdeploy": "echo \"Just deployed My Project to staging environment.\""
}
]
} When i run I’m using |
@Memeriaj Can we please reopen this? I'm observing this behaviour with No matter what I write as target-name, it runs pre-deploy for all of the targets. |
@Memeriaj Same here on |
I'm reopening this and assigning to @Memeriaj to take a look. |
Still an issue in 7.4.0 |
This is still an issue in version 12.5.2 |
Environment info
firebase-tools: 6.4.0
Platform: macOS
Test case
For example, following firebase.json runs every hosting targets predeploy hooks even if called with a single hosting deploy target
firebase deploy --only hosting:store
. After predeploy hooks are run, only the deploy target site is actually deployed.Steps to reproduce
Running
firebase deploy --only hosting:deploy-target
runs predeploy hooks for all hosting targets in multi-site hosting firebase.jsonExpected behavior
Deploying hosting with deploy target should run only the predeploy hooks of the deploy target
Actual behavior
Deploying hosting with deploy target runs all hosting targets predeploy hooks. Still, only the deploy target hosting site is actually deployed
The text was updated successfully, but these errors were encountered: