A
A
Al2017-02-07 12:40:30
git
Al, 2017-02-07 12:40:30

How to automate the process of uploading versions of a nodeJS application?

I looked at various questions and googled, but still I turn to you, I will describe the situation. There is an application (website) written on node, and using the cluster module to run on prod (maybe this somehow affects the operation of things like pm or forever, I don’t know yet). All tested on development machines with Windows, cluster works well in tandem with nginx. In general, everything seems to be OK with us, now it's time to put this creation on the prod server (there we host sites in php with apache + nginx, while node was not even installed there).
The project is stored on a server with gitalb, where development is carried out.
Option 1: It is necessary that the push field to the master branch triggers a hook that pulls "something" (you can write a sh script that unpacks the branch into the desired folder, but I don't know how correct this is), which will update the files in the project directory, and immediately restart the working server (for example, force forever to restart our application).
Obviously, this option is bad, especially if this application is running on several different machines. And then option 2:
No hooks, you need "something" with a web interface, and a simple config (such as specifying the repo address, authorization data, the desired branch). We press some thread of the "Deploy" button and the project files are updated, the application is restarted, profit.
What do you advise to do? And it is better to click on visual examples, with details.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2017-02-07
@alcyone

CI tools to help you. Build the application in .deb/.rpm via Jenkins and fpm, copy it to the server via scp and install it there. preinstall/postinstall scripts are supported by packages.

E
Egor Kazantsev, 2017-02-07
@saintbyte

Why does no one offer to finish the capistrano?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question