{"id":27472076,"url":"https://github.com/coding4deep/nodejs-java-ci-cd","last_synced_at":"2025-07-17T02:06:13.647Z","repository":{"id":283765598,"uuid":"952854472","full_name":"Coding4Deep/Nodejs-Java-CI-CD","owner":"Coding4Deep","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-25T14:15:21.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T14:42:58.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coding4Deep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-22T02:36:28.000Z","updated_at":"2025-05-25T14:15:24.000Z","dependencies_parsed_at":"2025-04-16T02:44:29.985Z","dependency_job_id":"ee8af1dd-46e0-4d84-b323-6da708ef3a61","html_url":"https://github.com/Coding4Deep/Nodejs-Java-CI-CD","commit_stats":null,"previous_names":["coding4deep/nodejs-java-project","coding4deep/nodejs-java-ci-cd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Coding4Deep/Nodejs-Java-CI-CD","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coding4Deep%2FNodejs-Java-CI-CD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coding4Deep%2FNodejs-Java-CI-CD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coding4Deep%2FNodejs-Java-CI-CD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coding4Deep%2FNodejs-Java-CI-CD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coding4Deep","download_url":"https://codeload.github.com/Coding4Deep/Nodejs-Java-CI-CD/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coding4Deep%2FNodejs-Java-CI-CD/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265559904,"owners_count":23788091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-16T02:28:04.154Z","updated_at":"2025-07-17T02:06:13.639Z","avatar_url":"https://github.com/Coding4Deep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD Pipeline for Java and Node.js Applications \n\nWelcome to the **CI/CD Pipeline Project**, a modern, automated solution for building, testing, and deploying **Java** and **Node.js** applications using **Jenkins**. This project demonstrates a seamless, fully integrated pipeline that ensures both applications are consistently deployed with top-notch code quality checks, automated testing, and efficient management.\n\n---\n\n## 🎯 **Project Overview**\n\nThis repository consists of **two Jenkins pipelines**, each handling different parts of the project:\n\n### 1️⃣ **Pipeline 1 - Java Application** (Maven-based)\n- **Automated Build \u0026 Test**: Compiles Java code and runs unit tests.\n- **Code Quality Analysis**: Runs **SonarQube** to ensure high-quality code.\n- **Artifact Deployment**: Deploys to **Nexus** for artifact storage.\n- **Application Deployment**: Deploys the Java application to **Tomcat**.\n- **Triggers Pipeline 2**: Parallerly, automatically triggers **Pipeline 2** (Node.js).\n\n### 2️⃣ **Pipeline 2 - Node.js Application** (npm-based)\n- **Automated Checkout**: Pulls the Node.js application from GitHub.\n- **Dependency Management**: Installs all required dependencies using **npm**.\n- **Unit \u0026 Jest Tests**: Runs tests to ensure application integrity.\n- **Code Quality Analysis**: Performs **SonarQube** code analysis.\n- **Deploy to Nexus**: Deploys the artifact to **Nexus** for versioning.\n- **Application Deployment**: Deploys the Node.js application using **PM2**.\n- **PM2 Status Check**: Verifies if the app is running successfully.\n\n---\n\n## 💡 **Project Goals**\n\nThis project strives to achieve:\n- **Automated Deployments**: From build to deployment for **both Java and Node.js** applications.\n- **Quality Assurance**: **SonarQube** integration for automatic code quality analysis.\n- **Real-time Notifications**: Instant **Slack** notifications about the build status.\n- **Efficient Management**: Deploy Java apps on **Tomcat** and manage Node.js apps with **PM2**.\n\n---\n\n## ⚙️ **How It Works**\n\nThis project leverages two pipelines to handle the automation of your applications:\n\n### Pipeline 1 (Java Application)\n1. **Checkout**: Clones the Java project from GitHub.\n2. **Compile \u0026 Test**: Builds and tests the application using **Maven**.\n3. **SonarQube Analysis**: Runs a code quality check using **SonarQube**.\n4. **Deploy to Nexus**: Deploys the Java artifact to **Nexus** for versioning.\n5. **Deploy to Tomcat**: Deploys the built application to the **Tomcat** server.\n6. **Trigger Pipeline 2**: On success, triggers **Pipeline 2** to start the Node.js pipeline.\n\n### Pipeline 2 (Node.js Application)\n1. **Checkout**: Clones the Node.js project from GitHub.\n2. **Install Dependencies**: Uses **npm** to install necessary packages.\n3. **Unit \u0026 Jest Tests**: Executes both **unit** and **Jest** tests for the application.\n4. **SonarQube Analysis**: Runs **SonarQube** analysis for Node.js code quality.\n5. **Start Application with PM2**: Deploys the Node.js app using **PM2**.\n6. **Verify Status**: Uses **PM2** to check the application’s running status.\n\n---\n\n## 🌟 **Why This Project?**\n\nThis project is designed to solve several challenges in modern development workflows:\n- **Automate everything**: No more manual deployments. Everything, from builds to tests to deployment, is automated.\n- **High-quality code**: Continuous **SonarQube analysis** ensures that your code maintains the highest standards.\n- **Real-time updates**: Stay informed with **Slack notifications** every time a build succeeds or fails.\n- **Seamless app management**: **Tomcat** for Java and **PM2** for Node.js makes managing your applications effortless.\n\n---\n\n## 🛠️ **Technologies Used**\n\n- **Jenkins**: For automating the entire build, test, and deployment pipeline.\n- **GitHub**: Hosts the source code for both Java and Node.js applications.\n- **Maven**: Handles the build and deployment for the Java project.\n- **SonarQube**: Analyzes the code quality to maintain high standards.\n- **Nexus**: Stores Java artifacts for deployment and versioning.\n- **Tomcat**: Hosts and runs the Java application.\n- **PM2**: Manages and runs the Node.js application efficiently.\n- **Slack**: Sends real-time notifications about build status.\n\n---\n\n## 🚀 **How to Set Up and Run**\n\n### 1️⃣ **Install Jenkins and Required Plugins**\n   - Install the following Jenkins plugins:\n     - **NodeJS** plugin\n     - **SonarQube** plugin\n     - **Slack Notification** plugin\n     - **JUnit** plugin\n\n### 2️⃣ **Configure Jenkins Tools**\n   - Go to **Jenkins Global Configuration** and add **Node.js** and **Maven**.\n\n### 3️⃣ **Set Up GitHub Repositories**\n   - Ensure your Java and Node.js projects are hosted on GitHub and have webhooks set up to trigger Jenkins jobs.\n\n### 4️⃣ **Create the Pipelines in Jenkins**\n   - **Pipeline 1** (Java): Create a Jenkins pipeline that handles the Java application’s build, test, SonarQube analysis, and deployment.\n   - **Pipeline 2** (Node.js): Create a Jenkins pipeline for Node.js that manages checkout, testing, SonarQube analysis, and PM2 deployment.\n\n### 5️⃣ **Integrate SonarQube**\n   - Set up **SonarQube** analysis for both projects to maintain code quality.\n\n### 6️⃣ **Add Slack Integration**\n   - Set up Slack webhooks in Jenkins to get instant notifications of build results.\n\n### 7️⃣ **Trigger Pipelines**\n   - **Pipeline 1** triggers **Pipeline 2** automatically upon successful completion.\n\n---\n\n## 📝 **Challenges Faced**\n\n- **Managing Two Different Tech Stacks**: Integrating both **Java (Maven)** and **Node.js (npm)** pipelines required handling separate build tools and environments.\n- **SonarQube Integration**: Ensuring that SonarQube correctly analyzes both Java and Node.js code with the same configurations.\n- **Deployment Management**: Deploying the Java app to **Tomcat** and the Node.js app using **PM2** required careful configuration of both servers.\n- **Monitoring and Notifications**: Configuring **Slack** notifications and **PM2 status checks** for real-time feedback on app performance.\n\n---\n\n## 🎉 **Conclusion**\n\nThis **CI/CD pipeline** provides a comprehensive solution for automating the deployment and management of **Java** and **Node.js** applications. By integrating tools like **Jenkins**, **SonarQube**, **PM2**, and **Slack**, this project ensures that both your applications are constantly tested, deployed, and monitored, giving you peace of mind and improved productivity.\n\n---\n\n### 🔧 **Get Started**\n\nClone this repository and adapt it to your own needs. Customize the pipeline scripts for your specific Java and Node.js projects, and you'll have a robust CI/CD solution in no time! 🎉\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoding4deep%2Fnodejs-java-ci-cd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoding4deep%2Fnodejs-java-ci-cd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoding4deep%2Fnodejs-java-ci-cd/lists"}