In this article, we are talking about how to Build Node.js and React application on Jenkins with Freestyle Project.

If you don’t have setup Jenkins on your machine please follow this article.

Setup Jenkins on CentOS with Docker for Selenium

After setting up Jenkins we need to configure NodeJS on Jenkins.

Install NodeJS plugin

Open Jenkins: Manage Jenkins > Plugin Manager > Install NodeJS plugin.

Image for post

Global Tool Configuration

Open Jenkins: Manage Jenkins > Global Tool Configuration > NodeJS

Set your compatible node version. We can set multiple NodeJS version for multiple application.

Image for post

1: Build Application with freestyle.

Create a Node application job

  1. Open Jenkins > New Item > Enter any job name> Choose Freestyle Project > Click on Save button.

Image for post

2. Source Code Management > Check Git and give Repository URL:

  • Git URL to your repo. Take this URL from Github. It should be the format of git@github.com:{username}/{repo}.git
  • Credentials: Select the one you created before.
  • Branches to build: $branch

Image for post

#javascript #automation-testing #jenkins #nodejs #ci-cd-pipeline

CI/CD Pipeline for a NodeJS Application with Jenkins
94.25 GEEK