Running Redwood scripts in production

Yeah it’s tough getting your head around things you used to do on a server when there are no more servers! I still struggle with this as I was a Rails dev for 12 years before starting to work on Redwood.

I’m not familiar with Vercel, but on other deploy targets like Netlify and Render, there’s a setting on their side that lists the deploy command(s) that are going to be run when you push to GitHub.

So if the default is yarn rw deploy vercel you can add on your script command in there so it runs on the next deploy: yarn rw deploy vercel && yarn rw exec myScript. After the next deploy you can update the command again back to the default, yarn rw deploy vercel.

I know it’s weird… I wish we could just do something like yarn rw exec myScript -e production and it would know how to connect to a remote server somewhere and run the command (we do this in Rails all the time!).

4 Likes