September 19-20, 2022 NYC

Automating Node.js deployment to a production environment with Shipit on CentOS 7

Shipit is a versatile deployment and automation tool for Node.js developers. It uses a task flow system based on the popular Orchestrator package, a login system and interactive SSH commands based on OpenSSH, and an extensible API. Developers can use Shipit to automate build and deployment workflows for a variety of Node.js applications.

Shipit workflows allow developers not only to configure tasks, but also to specify the order in which they are executed, whether synchronous or asynchronous execution is required, and the execution environment.

In this tutorial, we will install and configure Shipit to deploy a Node.js application from a local development environment to a production environment. We use Shipit to deploy the application and configure the remote server through the following steps:

Transferring Node.js application files from the local environment to the production environment (using rsync, git, and ssh).
installing the application dependencies (node modules).
setting up and managing Node.js processes on the remote server using PM2.

Prerequisites

Before starting this tutorial, you will need the following:

  • Two CentOS 7 servers (in this tutorial we will use app and web names for them) with a configured private network as instructed in the tutorial Configuring a Node.js application for a production environment in CentOS 7.
  • Nginx web server (on the web server) secured with TLS/SSL as described in the tutorial Securing Nginx with Let’s Encrypt in CentOS 7. If you complete the prerequisites in chronological order, you will only need to complete steps 1, 4, and 6 on the web server.
  • Installing Node.js and npm in a production environment. This tutorial uses version 10.17.0. To install it in macOS or Ubuntu 18.04, follow the Installing Node.js and Creating a Local Development Environment in macOS or the Installation with PPA section of the Installing Node.js in Ubuntu 18.04 guide.
  • Installing Node.js also installs npm, this tutorial uses version 6.11.3.
  • Local development computer with rsync and git installed.
  • On macOS, you can use Homebrew to install them.
  • For instructions on installing git on Linux distributions, see the Installing Git tutorial.

Leave a Reply