Posts

Showing posts with the label ci/cd

Guide to Setting Up CI/CD for NextJS with Jenkins, Gitlab, and AWS ECS

Image
Introduction In the previous article, I provided instructions on setting up CI/CD with Jenkins and Gitlab to deploy a NestJS project to AWS EKS. Now, I will provide similar guidance for deploying a project using the NextJS framework to AWS ECS, triggering an auto build on Jenkins when pushing code to Gitlab, and running tests for the project before deployment. A summary of the steps involved will be as follows: Build the Docker image for the NextJS project and push it to AWS ECR. Deploy that Docker image to AWS ECS. Set up Jenkins to connect with Gitlab. When code is pushed to Gitlab, Jenkins will trigger an auto build of the steps defined in the Jenkinsfile, including: Pulling the new code from Gitlab. Running tests for the project. If the test fails, stop the deployment process. If the test passes, proceed to the next step. Building the Docker image with the new code and pushing it to AWS ECR. Deploying to AWS ECS by restarting the service, which will use the latest Docker image to d...

Setting up a CI/CD Pipeline for NestJS with Jenkins, Gitlab, and AWS EKS

Image
Introduction Jenkins is a leading open-source automation tool that enables Continuous Integration (CI) and Continuous Delivery (CD). With its vast plugin ecosystem, Jenkins helps automate every stage from build and test to deploy, reducing manual errors and increasing software development speed. Gitlab is not only a Git-based source code repository but also provides a comprehensive DevOps platform. Gitlab's key advantages are tight repository management, built-in Webhooks to trigger external pipelines, and powerful project management and code review features that help teams collaborate effectively. In this article, I will guide you through setting up Jenkins to automatically pull source code from Gitlab and deploy to AWS EKS. The summary of the steps will be as follows: Build a source docker image from the NestJS source code and push it to AWS ECR Create an EKS Cluster and deploy with that docker image Setup configuration for Jenkins Add a Jenkinsfile to the NestJS project and push...

Guide to Setting Up Jest Testing for a NextJS Project

Image
Introduction In this article, I will guide you on adding Jest (currently the most popular testing library) to test for projects using the NextJS framework. This integration helps developers automate the source code testing process, from logical functions (Unit Testing) to user interface testing (Integration Testing) in the Node.js environment. Here are the prominent advantages: Fast and effective: Jest runs tests in parallel, saving significant time as the project scales. Built-in Support: Next.js provides the next/jest configuration, making setup extremely simple, automatically handling CSS files, images, and framework-specific features. Excellent Watch Mode: Jest has the ability to detect recently changed files and only run related tests, keeping the development workflow smooth. Coverage Reports: This tool has built-in capability to statistic the percentage of source code tested, helping you assess application quality and reliability visually. Rich ecosystem: When combined with React...