Deployed Static Website in AWS S3 bucket with jenkins pipeline

Step 1: Create S3 bucket

Make sure you give public access to this bucket while creating.

Step 2 : checkout repository for code

It contains all source code with Jenkinsfile pipeline file and aws s3 bucket policy

https://github.com/harish343/businessmail.git

Step 3: Create a pipeline in Jenkins

Step 4: Setup gitscm polling

Tick Github took trigger for gitscm

Enter Jenkins url in place of localhost://8080 I am using Jenkins on my local computer. Make sure you have Jenkins installed in the server.Then click Add Webhook.

Step 5 : Create an Iam user for AWS

Create I am a user for AWS and configure it with your pc

Step 6 : Add Jenkins url pipeline

Step 7 : Add Sonarqube

Create a project in Sonarqube and copy the command for manually checking

sonar-scanner \
  -Dsonar.projectKey=newpro \
  -Dsonar.sources=. \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.token=sqp_ff802c479c6d195ee9f3c927876ff84611097e89

here is the link how to setup project

https://devopstools.hashnode.dev/sonarqube

Step 8: Run the project in Jenkins

Change file in github repo and commit the code. jenkins will automatically trigger job

Step 9 : Monitoring AWS s3

we can done monitoring by AWS cloudwatch or Prometheus