Skip to content

Commit

Permalink
fix(v2): netlify.toml shouldn't affect v1 site deployment config (#3099)
Browse files Browse the repository at this point in the history
* netlify.toml shouldn't affect v1 site deployment config

* try to fix netlify setup

* try to fix netlify setup

* try to fix netlify setup
  • Loading branch information
slorber authored Jul 23, 2020
1 parent cbe3c77 commit 336c3e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,19 @@
"start:v1": "yarn workspace docusaurus-1-website start",
"start:v2": "yarn workspace docusaurus-2-website start",
"start:v2:watch": "nodemon --watch \"./packages/*/lib/**/*.*\" --exec \"yarn start:v2\"",
"start:v2:baseUrl": "BASE_URL='/build/' yarn start:v2",
"start:v2:baseUrl": "yarn workspace docusaurus-2-website start:baseUrl",
"build": "yarn build:packages && yarn build:v2",
"build:packages": "lerna run build --no-private",
"build:v1": "yarn workspace docusaurus-1-website build",
"build:v2": "yarn workspace docusaurus-2-website build",
"build:v2:baseUrl": "BASE_URL='/build/' yarn build:v2",
"build:v2:baseUrl": "yarn workspace docusaurus-2-website build:baseUrl",
"serve:v1": "serve website-1.x/build/docusaurus",
"serve:v2": "serve website/build",
"serve:v2:baseUrl": "serve website",
"serve:v2:ssl": "yarn serve:v2:ssl:gencert && yarn serve:v2:ssl:message && yarn serve:v2:ssl:serve",
"serve:v2:ssl:gencert": "openssl req -x509 -nodes -days 365 -newkey rsa:4096 -subj \"/C=US/ST=Docusaurus/L=Anywhere/O=Dis/CN=localhost\" -keyout ./website/.docusaurus/selfsigned.key -out ./website/.docusaurus/selfsigned.crt",
"serve:v2:ssl:message": "echo '\n\n\nServing Docusaurus with HTTPS on localhost requires to disable the Chrome security: chrome://flags/#allow-insecure-localhost\n\n\n'",
"serve:v2:ssl:serve": "serve website/build --ssl-cert ./website/.docusaurus/selfsigned.crt --ssl-key ./website/.docusaurus/selfsigned.key",
"netlify:build:production": "yarn build:v2",
"netlify:build:deployPreview": "yarn build:v2:baseUrl && yarn netlify:build:deployPreview:moveBuild && yarn netlify:build:deployPreview:redirects",
"netlify:build:deployPreview:moveBuild": "yarn rimraf website/netlifyDeploy && mkdir website/netlifyDeploy && mv website/build website/netlifyDeploy",
"netlify:build:deployPreview:redirects": "echo 'Writing Netlify baseUrl deployPreview _redirects file' && echo '/build/* /build/404.html 200' >> website/netlifyDeploy/_redirects && echo '/* /build/' >> website/netlifyDeploy/_redirects",
"netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug",
"changelog": "lerna-changelog",
"postinstall": "yarn build:packages",
"prettier": "prettier --config .prettierrc --write \"**/*.{js,ts}\"",
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml → website/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# default/production build
[build]
base = "/"
command = "yarn netlify:build:production"
command = "yarn workspace docusaurus-2-website netlify:build:production"
publish = "website/build"

# we build deploy previews with a /build/ baseUrl on purpose
# permits to test that baseUrl works fine (this often breaks!)
[context.deploy-preview]
command = "yarn netlify:build:deployPreview"
command = "yarn workspace docusaurus-2-website netlify:build:deployPreview"
publish = "website/netlifyDeploy"

# TODO this does not seem to work
Expand Down
9 changes: 8 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
"deploy": "docusaurus deploy",
"start:baseUrl": "BASE_URL='/build/' yarn start",
"build:baseUrl": "BASE_URL='/build/' yarn build",
"netlify:build:production": "yarn build",
"netlify:build:deployPreview": "yarn build:baseUrl && yarn netlify:build:deployPreview:moveBuild && yarn netlify:build:deployPreview:redirects",
"netlify:build:deployPreview:moveBuild": "yarn rimraf netlifyDeploy && mkdir netlifyDeploy && mv build netlifyDeploy",
"netlify:build:deployPreview:redirects": "echo 'Writing Netlify baseUrl deployPreview _redirects file' && echo '/build/* /build/404.html 200' >> netlifyDeploy/_redirects && echo '/* /build/' >> netlifyDeploy/_redirects",
"netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.58",
Expand Down

0 comments on commit 336c3e5

Please sign in to comment.