Deployment
2015-08-19I like automating things, and I like deploying applications. Fortunately, I get to do a lot of this.
For this website, I don't need all the build complexity of an enterprise-scale microservices architecture, so I just use a few simple scripts.
At first I dockerized this site, but I was having issues running Docker on my VPS (which only has 256MB RAM). So I simplified.
#!/bin/sh
npm run clean
npm run build
scp -r build user@xxx.xxx.xx.xxx:~/jcpst/
Yep, just scp
(secure copy). npm run clean
deletes my build/
directory, then npm run build
... builds. Then I copy the fresh build onto my
remote server. I already have http-server running using forever. I don't
need to stop it and the site updates with almost zero downtime.