Git Product home page Git Product logo

devops_project's Introduction

Project Devops CI/CD through Jenkins

Requirement:
> Git install
> Jenkins
> AWS console

  • Layout of Devops_Project

Launch the EC2 instances

Steps to create EC2 instances:

  • Choose an Amazon Machine Image (AMI):
  • we recommend the Amazon Linux 2 AMI (free-tier eligible).
    Choose an instance type: -we recommend the t2.micro (free-tier eligible).
  • Security group: you have the option to configure your virtual firewall.
  • Launch instance: review your instance configuration and choose "Launch".
    -Create a key pair: Select "Create a new key pair" and assign a name. The key pair file (.pem) will download automatically - save this in a safe place as we will later use this file to log in to the instance. Finally, choose "Launch Instances" to complete the set up.

  • Install Jenkins in EC2 Jenkin server:

Steps to install Jenkins:

First, we’ll add the repository key to the system.

  • $ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
  • When the key is added, the system will return OK. Next, we’ll append the Debian package repository address to the server’s sources.list:
  • $ echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
  • $ sudo apt-get update
  • $ sudo apt-get install jenkins
  • Using systemctl we’ll start Jenkins:
  • $ sudo systemctl start jenkins
  • $ sudo systemctl status jenkins
  • If everything went well, the beginning of the output should show that the service is active and configured to start at boot:
  • Output

jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled) Active:active (exited) since Thu 2017-04-20 16:51:13 UTC; 2min 7s ago Docs: man:systemd-sysv-generator(8)

Opening the Firewall

  • $ sudo ufw allow 8080
  • $ sudo ufw status
  • $ sudo ufw allow OpenSSH
  • $ sudo ufw enable

To set up our installation, we’ll visit Jenkins on its default port, 8080, using the server domain name or IP address: http://ip_address_or_domain_name:8080


  • Make new jobs


  • Add the repository git


  • Now Build the project,search the File pom.xml


  • Build the Project


  • Install Apache Tomcat in EC2 webserver


$ cat server.xml

Login webserver EC2 by SSH:

  • check the port number of Tomcat webserver


  • Copy IP ip_address_or_domain_name port 8090 check Tomcat server working fine.


  • Add Deploy to container Plugins in Jenkins


open file

$ cat tomcat-user.xml

  • check the credential of webserver passwd


Add credential of jenkins




  • ADD the credential and tomcat URL:


  • Build the Project, login webserver check the webapp/ dir


  • ADD the cron job click in Build Triggers


  • Buld the project


  • Copy the ip_address_or_domain_name browsable.


  • Change the code in github than again refresh the window.
    • Job automatically trigger.
    • Deployment of Webpage


devops_project's People

Contributors

vikasdevops avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.