darusuna.com

Automating Application Deployment with CI/CD Pipeline: A Guide

Written on

Chapter 1: Introduction to CI/CD Pipelines

In this project, I developed a CI/CD pipeline to streamline the deployment process for my development team. The goal was to automate the app deployment, eliminating the need for manual builds whenever updates were made to the codebase.

My team requested a solution to simplify the deployment process for our application. Previously, developers had to manually execute the build process to test any new changes. I needed to provide them with a static site URL and make necessary modifications to the code in the GitHub repository to ensure the pipeline functioned correctly.

Section 1.1: Forking the GitHub Repository

Subsection 1.1.1: Setting Up the S3 Bucket

To host the static website, I proceeded to configure an Amazon S3 bucket.

Configuration of S3 bucket for static website hosting

Following the initial setup, I enabled Access Control Lists (ACLs).

Enabling Access Control Lists for the S3 bucket

To allow public access, I unchecked the “block all public access” option. Note that this is not a recommended practice but was necessary for the scope of this project.

Adjusting public access settings for the S3 bucket

After finalizing these settings, I clicked on “create bucket.” However, additional configurations were required.

Finalizing the creation of the S3 bucket

Next, I navigated to the properties section of the bucket to enable static website hosting, specifying the index.html file.

Enabling static website hosting in the S3 bucket properties

After saving the changes, I proceeded to adjust the bucket policy to allow public access, following the guidelines from AWS documentation.

Configuring the bucket policy for public access CI/CD pipeline setup initiation

Section 1.2: Configuring the CI/CD Pipeline

I selected GitHub (Version 2) as my source provider and established a connection to the platform.

Connecting GitHub as the source provider

Initially, I had to complete several steps to link my GitHub account, but now it’s a straightforward selection.

Selecting the GitHub account for the CI/CD pipeline

I then picked the relevant repository and branch, proceeding to the next step.

Choosing repository and branch for the CI/CD pipeline

Subsequently, I opted for CodeBuild as my provider and created a new project.

Creating a CodeBuild project for the CI/CD pipeline

After naming the project, I selected the necessary options.

Configuring project settings in CodeBuild

I utilized a new service role along with a build spec file before moving on to CodePipeline.

Setting up CodePipeline after CodeBuild

As I continued, I reached the deployment stage where I selected S3 as my provider, chose the bucket, and opted to extract files before deployment.

Configuring deployment settings in CodePipeline

After reviewing all configurations, I created the pipeline, which usually requires some time to complete.

Finalizing the creation of the CI/CD pipeline

Upon successful build and deployment, I accessed my bucket, located the index.html file, and copied its URL to paste into my browser.

Accessing index.html in the S3 bucket

The application was up and running!

Successful deployment confirmation

Lastly, I needed to verify that my pipeline would trigger upon changes made to the GitHub repository. I made a quick edit to the README file as a test. After committing the changes, I checked the pipeline status.

Monitoring the CI/CD pipeline status

The pipeline was in progress, and it succeeded, confirming that the changes went through.

Successful CI/CD pipeline execution

To ensure everything was functioning correctly, I quickly reviewed the history.

Checking the CI/CD pipeline history

Everything looked great! Our developers are now relieved from manually building their code for each update. Thank you for reading, and I hope you found this guide helpful.

Jason Wood

@jwood9799

Chapter 2: Video Tutorials on CI/CD Automation

This video walks you through the AWS Academy Cloud Developing Lab, focusing on automating application deployment with a CI/CD pipeline.

In this lab module, you will learn how to automate application deployment using a CI/CD pipeline effectively.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Should We Be Concerned About the COVID-19 Vaccine Developments?

An overview of the safety and approval process for COVID-19 vaccines, addressing common concerns while providing insights from ongoing research.

Insights into North America's Industrial Landscape and Geo-Politics

Explore emerging trends in North American industries, focusing on energy production, mining, and geopolitical influences shaping the future.

A Call to Action: The Urgent Need for Climate Awareness

This article emphasizes the importance of reshaping public perceptions and media engagement regarding climate change.