I'd like to run a script to seed data and create u...
# help
I'd like to run a script to seed data and create users (if they don't exist) after successful sst build. Any ideas?
Hey @Abdul Taleb, currently I’ve seen ppl do it in their command line, ie. make the npm deploy script:
Copy code
"deploy": "sst deploy && node seedDB.js"
Does that work for you?
That works
To add to this question how can i set environment variables that the script needs to access, also how can I only do this in local dev?
is the
flag available within the sst stack?
yup, it is
I tested this out with
sst start
and since it's an ongoing process, the script doesn't run until I
ctrl + c
. Trying to write a script using
but haven't gotten to a working solution.
Actually, let me see if I can do something on the SST side.
I will add a
construct, and you can configure it to run after the other resoruces are deployed.
I can try to get this done by today or tmr.