feat: change preview api url #1584
|
@ -123,7 +123,6 @@ steps:
|
|||
- yarn serve:dist & npx wait-on http://localhost:4173
|
||||
- yarn test:frontend --browser chrome --record
|
||||
depends_on:
|
||||
- dependencies
|
||||
- build-prod
|
||||
|
||||
- name: deploy-preview
|
||||
|
@ -137,6 +136,9 @@ steps:
|
|||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
commands:
|
||||
- cp -r dist dist-preview
|
||||
# Override the default api url used for preview
|
||||
- sed -i 's|localhost:3456|try.vikunja.io|g' dist-preview/index.html
|
||||
|
||||
- shasum -a 384 -c ./scripts/deploy-preview-netlify.js.sha384
|
||||
- node ./scripts/deploy-preview-netlify.js
|
||||
depends_on:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[build]
|
||||
command = "yarn build"
|
||||
publish = "dist"
|
||||
publish = "dist-preview"
|
||||
|
||||
[[redirects]]
|
||||
from = "/*"
|
||||
|
|
Reference in New Issue
Great idea! We should make sure this doesn't interfer with the tests since the same bundle is used for the tests as well.
Wouldn't that collide here:
27bba71d8a/.drone.yml (L122)
?I think so yes. Because
yarn serve:dist
will only serve whatever is in thedist
folder, and if that gets reloaded we'll probably use the wrong api for the tests.An option would be to wait with the deploy step until the tests are done.
I think linting is fine, since it's so fast (didn't check if we do that already).
If we wait for Cypress it will take a lot longer. I wouldn't like that.
Then I think copying the dist folder, making the adjustments and then deploying that would be the way to go?
After thinking about it I think I'm not understanding what you mean, sry :D
What shall I adjust?
Something like this:
And then adjust the netlify deploy script to deploy
dist-preview
instead ofdist
.Adjusted! :check
Does it work? Looks like the link is broken.
I think I know why. Doesn't netlify build it again?
And if not what else is the
yarn build
in the netlify.toml for?Usually netlify builds the site when pusing to the git repo - that's what the config parameter is required for. We're not really using that though.
I removed it before – that didn't work. But now it also doesn't work with it :D