Skip to content
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

FIX deploy with-firebase-hosting #3946

Merged
merged 9 commits into from Mar 8, 2018
3 changes: 2 additions & 1 deletion examples/with-firebase-hosting/package.json
Expand Up @@ -7,7 +7,8 @@
"dev": "next src/app",
"serve":
"echo \"for details see:\n\thttps://github.com/firebase/firebase-tools/issues/535 \n\thttps://github.com/zeit/next.js/issues/3167\";",
"deploy": "firebase deploy",
"predeploy": "mkdir -p \"dist/functions\"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need this as build-funcs will create this when run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we must run firebase deploy in dist/functions for fix the problem. If i run yarn clean and after cd \"dist/functions\" && firebase deploy, we have an error because dist/functions not exists.

Copy link
Contributor

@jthegedus jthegedus Mar 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd "dist/functions" && firebase deploy

It errors because after you cd into dist/functions firebase deploy tries to deploy a directory called dist/functions which doesn't exist from the relative directory of dist/functions .

firebase deploy knows to deploy dist/functions from https://github.com/zeit/next.js/pull/3946/files#diff-0bde36a03f5abc11a925591823b9d3c2R13

"deploy": "cd \"dist/functions\" && firebase deploy",
Copy link
Contributor

@jthegedus jthegedus Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this shouldn't be required either because https://github.com/zeit/next.js/blob/76582b8e437dadc4dce18ec6ee525acb6f0d2cdb/examples/with-firebase-hosting/firebase.json#L13 should be picked up on firebase deploy.

And moving dir might mess up the deployment step of any hosting or db parts of the deployment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why...but this doesn't work for me...

"clean": "rimraf \"dist/functions\" && rimraf \"dist/public\"",
"build-public": "cpx \"src/public/**/*.*\" \"dist/public\" -C",
"build-funcs": "babel \"src/functions\" --out-dir \"dist/functions\"",
Expand Down