6

I need to set up automatic remote updates for my app built on nodeJS (not the nodeJS itself).
In my specific case I can't distribute my app as SaaS, so I have to share a copy of app with each client.

I've checked related topics here, but haven't found helpful ones.
Here are a few related questions: one, two

I don't know how to set it up, but I have a few ideas:


old-school way (?) :

  1. use unix cron + shell (or php) script to make «check-request» to «update-server»,
  2. stop nodeJS instance,
  3. replace files with newest ones from tarball,
  4. run nodeJS instance with my app : from shell(?)

It may work if I use my own server, but how can I do the same on, for example, Heroku ?
Overall, it seems weird a bit.


two nodeJS instances way (?) :

  1. use unix cron + another nodeJS app which checks updates on update-server,
  2. then stop one node instance from another && update files
  3. start one nodeJS instance with my app from another : how???

— Is here something else?
— How do folks solve that problem?
— How to realize, for instance, functionality like «Update manager» in Wordpress for nodeJS based app?

Community
  • 1
  • 1
philipp.b
  • 63
  • 4

1 Answers1

1

What you're talking about is CI (continuous integration), there are many tools that can help you in the process but they essentially do the same thing.

  1. Detect a change in the code
  2. Pull changes
  3. Build the project
  4. Run tests if there are any
  5. Deploy to the server

— How do folks solve that problem?

Folks use Jenkins, bamboo and many other auto deployment systems. If you're using node with pm2 you can use kinematic that has that build in (one-click deployment feature)

dcohenb
  • 2,099
  • 1
  • 17
  • 34