Day 51: CI/CD Pipeline on AWS - Part 2
Task-01 :
you have to build the index.html using nginx server
Add buildspec.yaml file to CodeCommit Repository and complete the build process.
we will continue from part 1.
Step-by-Step Guide:
- Setting up the Build Project in AWS CodeBuild:
Navigate to the AWS Console and create a new build project.

- Provide a meaningful name and description for your project.

Choose AWS CodeCommit as the source provider and select the repository created in Part 1, along with the desired branch.

For the environment, select Ubuntu as the operating system and the latest version of the image.

Create a new service role.

Configure the S3 bucket for storing artifacts.

Then click on create project

- Creating the buildspec.yaml file:
Include the following contents in your buildspec.yaml file:
version: 0.1
phases:
install:
commands:
- echo Installing NGINX
- sudo apt-get update
- sudo apt-get install nginx -y
build:
commands:
- echo Build started on `date`
- cp index.html /var/www/html/
post_build:
commands:
- echo Configuring NGINX
artifacts:
files:
- /var/www/html/index.html
It will install NGINX on our environment and will copy our index.html to /var/www/html/ folder. It also creates artifacts.
- Pushing to CodeCommit and Initiating the Build:
Push both the index.html file and buildspec.yaml to your CodeCommit Repository.
Start the build process and monitor the status and progress in the AWS CodeBuild console.

Go to your phase details and check status of build stages.

Verify the successful creation of artifacts in your designated S3 bucket.

You've successfully built the index.html file using NGINX server and incorporated the buildspec.yaml file into your CI/CD pipeline. See you in part -3



