serverless-nextjs / serverless-next.js

⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
MIT License
4.46k stars 456 forks source link

custom .serverless folder for different stages #309

Open diegopamio opened 4 years ago

diegopamio commented 4 years ago

serverless-next.js/packages/serverless-nextjs-component/examples/multiple-instance-environment/ example shows how to deal with multiple environments, but for those of us that commit the .serverless folder to avoid generating a cloudfront distribution on each push, this would be an issue.

Is there any way to tell serverless-nextjs the name of the .serverless folder, so we can commit one for each environment generated instead of maintaining two versions, one on each branch forever?

teemuniiranen commented 4 years ago

This would solve creation of new cloudfront distribution and allow centralized building and deployment for multiple environments without different directories and duplicated serverless.yml files.

uclaeamsavino commented 4 years ago

Sorry I'm new to serverless-next, trying to evaluate it to see if it will work for us. Does the .serverless file change constantly as you're developing/deploying?

If so, and you keep different .serverless folders for each stage, then it seems like you'd have to manually deploy locally (run serverless) to each stage to make sure that the .serverless file gets updated for that stage.

Well maybe it wouldn't matter as long as you're not creating new resources in AWS.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.