Jenkins CICD With AWS

Jenkins CICD With AWS

Version control: GIT Build tool : Maven CI tool : jenkins Artyfactory CD : Jfrog Code Analyzer : SonarQube

Instance = server SSH= ( Linux to Linux) Http = we can access web server from interner AWS account Creation Create AWS ec2 server

  1. Choose ec2 service

  2. Choose Launch instance

  3. Choose instance count and name

  4. Choose Ubuntu 18 linux server as AMI, it is OS

  5. Chooser instance type as T2.micro , it has one core CPU,One GB ram

  6. Create pem file , it just like password

  7. Create Security group as SSH and Http

  8. Choose 8gb of EBS Volume , it is link Hard Disk

  9. By launch instance , we can create server on aws cloud How to make this Cloud server as webserver?

  10. Install git on your laptop

  11. By using pem file and gitbash , we can able to getting to server $ sudo -i

apt-get update

apt-get install apache2

  1. We can create a version for very change by dev with time stamp

  2. We can able to go back older versions

  3. We can auto merge ( if it is possible)

  4. We can create Branches

    Version control are two types

    1. Client and server ART
    1. Distributed ART:

How can we use git ?

  1. Create github.com account

  2. Create git token ( it is just link passwd)

  3. Install git on your laptop

  4. Create git remote Repo

  5. Create a folder on your laptop and open on folder

  6. git bash ( only one time) echo "# mytest"

  7. \>> README.md

  8. git init

  9. git add README.md

  10. git commit -m "first commit"

  11. git config --global user.name "maha devops"

  12. git config --global user.email "maha@gmail.com"

  13. git commit -m "first commit"

  14. git branch -M main

  15. git remote add origin https://github.com/maha4dsvc/myGit08feb23.git

  16. git push -u origin main ( for very change)

  17. git add -A

  18. git commit -m “comment”

  19. git push

  20. Working tree : any change ( create/delete/update/edit)

  21. Staging Area : git add -A

  22. Local Repo : git commit -m “ comment” (.git folder)

  23. Remote Repo : git push (github.com/maha4dsvc)

How two dev working with git repo

git checkout -b < new Branch name> : create a new branch and switch

git checkout : without create new branch switch branch

git merge : merge branch

How does git work?

Git cat-file

Git stash

1st day of java line of code

2nd day of java line of code

3rd day of java line of code

4th day of java line of code

As dev

Task on reg page

It has to complete in 5 days

myjavaAddfunPage.java

Complete manager work

1st day of java line of code

2nd day of java line of code

3rd day of java line of code

4th day of java line of code

5th day of java line of code

Git cherry-pick c1,c2,c4 ………cn

Git rebase

Working tree : any change ( create/delete/update/edit) : git restore

Staging Area : git add -A : git restore --staged

Local Repo : git commit -m “ comment” (.git folder) : git reset HEAD~1

Default : git reset HEAD~1 : move back to working tree

Soft: : git reset --soft HEAD~1 : move back to Staging area

Hard : git reset --hard HEAD~1 : change will delete

● We can reset latest commit only from HEAD

● We can’t reset any middle commit

● It is not maintain any history

Remote Repo : git push (github.com/maha4dsvc) : git revert

● We can revert any commit

● It is maintain history