sst / sst

Build full-stack apps on your own infrastructure.
https://sst.dev
MIT License
21.99k stars 1.67k forks source link

Build artifacts when developing in a separate stage to test/deploy #4401

Open dmeehan1968 opened 3 months ago

dmeehan1968 commented 3 months ago

I just started adding a separate stage for my deploy's, as I move my project towards beta/release.

I'm finding that when I sst deploy --stage production that my currently running 'dev' stage gets broken, seemingly because the build output from the deploy overwrites/modifies the working files of the 'dev' stage. What I'm seeing is errors on the dev stage saying the files are not found, or that the generated output gets corrupted.

I would have expected each stage to be built in a discrete build directory, but this doesn't seem to be the case, and I don't see CLI options to override this.

Steps:

  1. sst dev next dev and leave it running, project open in the browser
  2. sst deploy --stage production to deploy to the prod/working environment to allow others access for testing
  3. When further navigating in the browser for the dev instance, I start seeing corruptions or errors. If I then re-run sst dev... this resolves and all works as expected.

How do I make the build artifacts discrete?

thdxr commented 3 months ago

this is a good point, our temporary directory right now is .sst/artifacts/xxx we should probably make that .sst/artifacts/stage/xxx