0% found this document useful (0 votes)
12 views35 pages

AWS CICD Project Report Brief With SS

Uploaded by

ahnaftajwarafif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views35 pages

AWS CICD Project Report Brief With SS

Uploaded by

ahnaftajwarafif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

At first, we’ll upload the code to the following GitHub repository.

https://github.com/ahnaf-tajwar

First, we will create an Amazon EC2 instance using the following configuration.
After that, keeping everything default we will click on the launch instance.
Now we will connect to the instance by selecting the instance and clicking on the connect button on
top.
This is how it should look like.
Now to install jenkins we will go through the following procedures and commands.

Then,
Now we will install Java Development Kit because Jenkins runs on Java, and verify the java
installation.
Now, we will import the jenkins GPG key

And now add the Jenkins Debian repository to my system’s sources list:

Now, we will update the package list again to include Jenkins packages and then install jenkins
Now we will start the jenkins service and will also enable Jenkins to start on boot by using sudo
systemctl start jenkins, sudo systemctl enable jenkins. Then we can verify the status of jenkins by
using sudo systemctl status jenkins

But Jenkins runs on port 8080. So we need to open port 8080. We can do that by editing the inbound
rules of the security group of my EC2 Production Server. And for now I’ll configure it so that only I
can access it through my IP.
Now if we go to the public IP of the instance:8080 we can access Jenkins
We will get the password and put it there

We will click on Install suggested plugins and let it do it’s thing.

And then fill out the next page, with necessary information.
This is the jenkins dashboard.

We will add a new item,


Before going for credentials, we will generate ssh key.
Now we got our private and public key. If we want to connect github to our server we have to give it
the public key. To do that, we will go to github settings and go to SSH and GPG keys and add a new
ssh key.

Now we will add credentials inside Jenkins.


Now we will select the previously made credentials.
Now we will just save it.

Now we will click on Build now.


This is the console output.

Now we can check it.

We have already uploaded the dockerfile with necessary commands on github.


Now we will follow the Readme file.
Now we will run the app.

Now we have to give access the the port 8000 by adding it into the inbound rules of the Production
server.

Our app is running on port 8000


Now we will run it on docker container. So that it doesn’t stop running everytime we close it.

Now we will build and run the docker.


We will first install the docker.
Then build the docker.

Now we will run the container.

We can verify it.

And now our app is running again.


Now we will run it through jenkins by configuring it inside the Jenkins. We will first kill the docker.

And put the commands in Jenkins execute shell command.

And then save it. Now let’s click on build now.


We can see from the console output that the build is successful.
Now our app is running automatically through Jenkins.

Now we will use Webhook.


First, we will install a plugin in Jenkins named GitHub Integration.

In the meantime, we will configure our Webhook in github. And also we will give access to the port
8080 to anywhere IPv4 which was previously configured as my IP.
Now we will select the following. And save the new change in the configuration.
Now if we change the code in github, it will automatically trigger a new build in Jenkins and show
the new app, in the browser.

We change it to the following, and save the file. It automatically triggers a new build and
successfully change and update it in the browser.
We can see that the change has been done by GitHub push.
We can add a new heading, and it will do the change.
And now this is the functionality of the app.
And if I click on the cross button, it is removed.
We can also monitor the Production Server using Amazon CloudWatch.
And this is the app link
http://3.81.109.27:8000/

You might also like