Filip Pyrek [AWS Hero]
02/15/2022, 10:52 PMstage
dynamically in SST? For example in my case based on git branch.
In Serverless Framework I’ve accomplished this via javascript file variables. Inside the file was a function which extracted git branch and returned it as a string which then became value of the stage
variable.Derek Kershner
02/15/2022, 11:20 PM--stage
arg on whatever command you are runningDerek Kershner
02/15/2022, 11:21 PMFilip Pyrek [AWS Hero]
02/15/2022, 11:31 PM<http://sst.App|sst.App>
is readonly
variable stage
. I need to be able to set a value of it for example from within the main
function.Filip Pyrek [AWS Hero]
02/15/2022, 11:33 PMFilip Pyrek [AWS Hero]
02/15/2022, 11:40 PMAshishkumar Pandey
02/15/2022, 11:49 PMsst.json
.Derek Kershner
02/16/2022, 12:01 AMDerek Kershner
02/16/2022, 12:02 AMDerek Kershner
02/16/2022, 12:06 AMmain
, and therefore cant control those parameters, at least on the code sideDerek Kershner
02/16/2022, 12:13 AMAshishkumar Pandey
02/16/2022, 12:15 AMsst.json
do the trick? 🤔Derek Kershner
02/16/2022, 12:16 AMDerek Kershner
02/16/2022, 12:17 AMAshishkumar Pandey
02/16/2022, 12:17 AMsst.json
?Derek Kershner
02/16/2022, 12:18 AMAshishkumar Pandey
02/16/2022, 12:22 AMOmi Chowdhury
02/16/2022, 12:35 AMthdxr
02/16/2022, 12:38 AMthdxr
02/16/2022, 12:38 AMAshishkumar Pandey
02/16/2022, 12:42 AMFrank
main
. SST needs to know the stage
prior to that point, ie. to setup Live Lambda environment, SST console, etc.Frank
sst deploy --stage $GITHUB_REF_NAME
Filip Pyrek [AWS Hero]
02/16/2022, 6:30 AM