Jenkins Installation on EC2
Continuous Integration
- Developers will push and commit changes continuously to the git.
- It is a development practice where developers merge their code to remote repository git/SCM multiple times a day.
- The merged code goes through a build(compile-->test-->SonarQube verify--> etc).
Benefits of CI:
- Fast feedback
- Easy to fix any issues
- improves Productivity
- Avoid issues at early stages
- Can avoid rework at testing level or production level.
Continuous Delivery
Is an automated process which begins after CI successful completion and it automates the deploying app from development to Production.
Note: Before production , there will be certain approvals based on the organization structure , which will be manual approval process
Continuous Deployment: Its a same as Continuous delivery but no approval required.
Difference between Continuous Delivery and Continuous Deployment.
Ans: There is no manual approval is required in case of Continuous Deployment.
Jenkins Job post build Notifications:
Email Notifications
- We have to configure SMTP setting on Jenkins,
- Lets use Gmail on our case for practice,
- Its not good idea to use third party SMPT servers like gmail because of security reasons.
Install Jenkins on EC2 instance.
Security Group should be like below for Ec2 instance , so that we will get public access for our EC2 instance.
- First create EC2 instance on AWS (am creating AMazon Linux EC2 )
- Connect using Putty with EC2 instance
- Login as root user
- Install Java
- Verify java version
- Go to the website: https://pkg.jenkins.io/redhat-stable/
- execute command: sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
- Adding a gpg check key: sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
- Now execute yum install jenkins
- To start Jenkins: systemctl start jenkins
- systemctl enable jenkins : To enable at Boot time.
- To check the status of Jenkins: systemctl status jenkins
- Copy EC2 instance public IP and paste in browser For ex: http://13.127.40.180:8080/
- It will open the page below
- Go to instance, execute command : cat /var/lib/jenkins/secrets/initialAdminPassword
- copy the passoword and paste in above Admin password.
- Click on "install suggested plugins"
- Once install done , create Admin user
- Once done next and start jenkins
Your Jenkins setup is ready.
No comments:
Post a Comment