Skip to content

sharma-sankalp/nodejs-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Jenkins Pipeline for Java based application usingnpm, Argo CD, Shell Script and Kubernetes.

Here are the step-by-step details to set up an end-to-end Jenkins pipeline for a NodeJS application using Argo CD, Shell Script, and Kubernetes:

Prerequisites:

NodeJS application code hosted on a Git repository Jenkins server Kubernetes cluster Shell Script Argo CD

Steps:

  1. Containerization
  • Dockerfile
  • Create a Dockerfile to containerize the Node.js application. The container will run the web server on port 8000.
  1. Continuous Integration Setup
  • CI Tool: Jenkins

We will use Jenkins to automate the testing and building of the Docker image. Here are the steps to set up Jenkins:

  • Install Jenkins:

Download and install Jenkins from the official website.

  • Install Necessary Plugins:

Docker Pipeline Plugin Git Plugin

  • Set Up a Jenkins Pipeline:

Create a Jenkins Pipeline script (Jenkinsfile) in the root directory of your project:

  1. Define and configure the pipeline stages: Stage 1: Checkout the source code from Git. Stage 2: Build the NodeJS application using npm. Stage 3: Run the tests. Stage 4: Build the Docker image. Stage 5: Push the Docker image to Docker Hub. Stage 6: Deploy the application to a stage environment using Helm.

  2. Continuous Delivery Setup

  • CD Tool: ArgoCD

Use ArgoCD to manage the deployment to the staging environment.

  • Install ArgoCD:

Follow the installation guide to install ArgoCD in your Kubernetes cluster.

  • Configure ArgoCD Application:

Create an ArgoCD application configuration file (argo-app.yaml):

  1. Configure Jenkins pipeline to integrate with Argo CD: 6.1 Add the Argo CD API token to Jenkins credentials. 6.2 Update the Jenkins pipeline to include the Argo CD deployment stage.

  2. Create Kubernetes Manifests: Create Kubernetes deployment and service manifests in the manifests directory of your repository:

manifests/deployment.yaml manifests/service.yaml:

  1. Run the Jenkins pipeline: 7.1 Trigger the Jenkins pipeline to start the CI/CD process for the NodeJS application. 7.2 Monitor the pipeline stages and fix any issues that arise.

This end-to-end Jenkins pipeline will automate the entire CI/CD process for a NodeJS application, from code checkout to Stage deployment, using popular tools like Argo CD, Shell Script, and Kubernetes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors