feat: Add target as option to deploy cli command.#9766
feat: Add target as option to deploy cli command.#9766SandPod wants to merge 3 commits intofacebook:mainfrom
Conversation
|
Hi @SandPod! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
| shellExecLog(`git checkout -B ${deploymentBranch}`); | ||
| shellExecLog(`git remote add origin ${deploymentRepoURL}`); |
There was a problem hiding this comment.
Chore: need to correct these lines here, this will always create a new branch since we fetch with depth 1 on the line above. Need to fetch information about any existing branch before calling checkout with -B.
We also need to bind the remote correctly in all cases.
Pre-flight checklist
Motivation
The deploy script makes a hard assumption that the remote repository only stores Docusaurus files.
In our case we have a
CNAMEfile in the root of the repo and therefore have placed all Docusaurus files in adocsfolder. Therefore, we cannot utilize this scripts since we can't specify the target directory.This PR adds a CLI option to specify the target directory and ensures that one the target directory is cleared out while the rest of the repo is left intact.
Review guidelines
This is an initial attempt to see if it is something that is worth finalizing and goes in the direction the maintainers of the project would like to see.
The PR is best reviewed commit by commit where each commit attempts to apply a single change. Hopefully this can help clarify if I have misunderstood how things should be implemented.
Test Plan
Would have loved to have #7714 merged for automatic validation of these changes.
Failing a snapshot test right now, I'm not a Javascript native developer and don't feel comfortable updating snapshots without understanding the implication.
The test that is currently failing should fail since I have actually added a new prop.
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs