Last year it took three days to develop a simple nodeJS publishing system based on pM2’s deploy mechanism. The main principle is to communicate directly between two pM2 machines and execute corresponding commands. To put it more simply, commands are executed remotely from a publishing machine, and rosefinch publishing system provides a graphical interface.

The system was positioned as a NodeJs-only publishing system because it relied on PM2, a nodeJs-only process management tool not available in other languages. The launch of this system solves the problem that our company does not have a suitable NodeJS publishing system.

After 9 months of use, it is also relatively stable. But there are problems, the biggest of which is the complexity of deploying applications.

The basic process is as follows:

  • Configure SSH communication between the publisher and the application server.

  • Git is installed on the application server (shipped, but too old).

  • Configure the git username and email address.

  • Generate an SSH public key.

  • Configure the application server’s public key to the Git code server. So I can pull the code.

  • The publishing machine performs Git pull remotely to manipulate the code, and the application service pulls the code down.

  • Perform the compile package operation.

  • Restart the service.

If you have multiple application servers, you may have to repeat the operation many times.

It’s easier to synchronize code using SCP, but for projects like NodeJS, node_module is a big part of the package, which slows synchronization down every time, and SCP doesn’t have the ability to exclude folders.

Finally, the rsync command was found to meet the requirements. Then a version was implemented based on Rsync.

How does Rosefinch compare to Jenkins?

Jenkins is definitely the big brother in the continuous integration space. But every team and product is unique and Jenkins doesn’t fit perfectly. And rosefinch has its advantages.

  • Rosefinch itself is simple to deploy, developed using GO, independent of runtime, no installation required, right out of the box.

  • Currently supported and tested databases are SQlite3 (currently in use, without the tedious installation process) and mysql.

  • The configuration is simple.

  • Deployment publishing is done with one click and no separate deployment process is required.

  • Parallel publishing.

  • Approval, notification, permissions.

  • Open source, customizable development.

Project address: Rosefinch Publishing System

Original: www.yuedun.wang/blogdetail/…