Introduction to Erlang/OTP production applications deployment

后端 未结 2 473
清酒与你
清酒与你 2020-12-23 15:05

I would like to develop and deploy an Erlang/OTP application into production on a VPS.

I am pretty familiar with developing Erlang code on a local machine and my que

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 15:37

    While @I GIVE CRAP ANSWERS gave a pretty thorough summary, I feel compelled to throw in the use of sync, which helps to automate the hot-recompiling and reloading of modules.

    The simple way is you specify sync as a rebar dependency, then when you're getting ready to deploy an upgrade, you can run sync:go() on the Erlang node. This starts the sync engine, which watches for filesystem changes. Then you can use git to push to your server. Sync will notice the files change, recompile them, and load the new beams automatically.

    Then, you can run sync:stop() right away to tell the system to stop watching for filesystem changes (it's generally not recommended to keep sync running on a live server, just to prevent accidental recompiling if, for whatever reason, a source file changes and it's unintentional.

提交回复
热议问题