Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

DevOps for Web Development
DevOps for Web Development
DevOps for Web Development
Ebook529 pages4 hours

DevOps for Web Development

Rating: 0 out of 5 stars

()

Read preview

About this ebook

If you are a system admin or application and web application developer with a basic knowledge of programming and want to get hands-on with tools such as Jenkins 2 and Chef, and Cloud platforms such as AWS and Microsoft Azure, Docker, New Relic, Nagios, and their modules to host, deploy, monitor, and manage their web applications, then this book is for you.
LanguageEnglish
Release dateOct 24, 2016
ISBN9781786468352
DevOps for Web Development

Read more from Mitesh Soni

Related to DevOps for Web Development

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for DevOps for Web Development

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    DevOps for Web Development - Mitesh Soni

    Table of Contents

    DevOps for Web Development

    Credits

    About the Author

    Acknowledgments

    About the Reviewer

    www.PacktPub.com

    Why subscribe?

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Downloading the color images of this book

    Errata

    Piracy

    Questions

    1. Getting Started – DevOps Concepts, Tools, and Technologies

    Understanding the DevOps movement

    DevOps with the changing times

    The waterfall model

    The agile model

    Collaboration

    Cloud computing - the disruptive innovation

    Why DevOps?

    The benefits of DevOps

    The DevOps lifecycle - it's all about continuous

    Build automation

    Continuous integration

    Best practices

    Cloud computing

    Configuration management

    Continuous delivery/continuous deployment

    Best practices for continuous delivery

    Continuous monitoring

    Continuous feedback

    Tools and technologies

    Code repositories – Git

    Advantages

    Characteristics

    Differences between SVN and Git

    Build tools – Maven

    Example pom.xml file

    Continuous integration tools – Jenkins

    Key features and benefits

    Configuration management tools – Chef

    Features

    Cloud service providers

    Container technology

    Docker

    Monitoring tools

    Zenoss

    Nagios

    Deployment orchestration/continuous delivery - Jenkins

    End-to-end orchestration: Jenkins plugins

    The DevOps dashboard

    An overview of a sample Java EE application

    The list of tasks

    Self-test questions

    Summary

    2. Continuous Integration with Jenkins 2

    Introduction

    Installing Jenkins

    Setting up Jenkins

    The Jenkins dashboard

    Configuring Java and Maven in Jenkins

    Configuring Java

    Configuring Maven

    Creating and configuring a build job for a Java application with Maven

    Configuring and authenticating source code on GitHub

    Configuring build job

    Configuring JUnit

    The Dashboard View plugin - overview and usage

    Managing nodes

    Creating and configuring slave node in Jenkins 2

    Configuring the build job for master and slave node

    Sending e-mail notifications based on build status

    Integrating Jenkins and Sonar

    Self-test questions

    Summary

    3. Building the Code and Configuring the Build Pipeline

    Creating built-in delivery pipelines

    Creating scripts

    Example 1 – creating a Groovy script to build a job

    Example 2 – creating a build step to publish test reports

    Example 3 – archiving build job artifacts

    Example 4 – running a build step on a node

    Example 5 – marking the definite steps of a build job

    Creating a pipeline for compiling and executing test units

    Using the Build Pipeline plugin

    Integrating the deployment operation

    Self-test questions

    Summary

    4. Installing and Configuring Chef

    Getting started with Chef

    Overview of hosted Chef

    Installing and configuring a Chef workstation

    Converging a Chef node using a Chef workstation

    Installing software packages using cookbooks

    Creating a role

    Self-test questions

    Summary

    5. Installing and Configuring Docker

    Overview of Docker containers

    Understanding the difference between virtual machines and containers

    Installing and configuring Docker on CentOS

    Creating your first Docker container

    Understanding the client-server architecture of Docker

    Managing containers

    Creating a Docker image from Dockerfile

    Self-test questions

    Summary

    6. Cloud Provisioning and Configuration Management with Chef

    Chef and cloud provisioning

    Installing knife plugins for Amazon Web Services and Microsoft Azure

    Creating and configuring a virtual machine in Amazon EC2

    Creating and configuring a virtual machine in Microsoft Azure

    Docker containers

    Self-test questions

    Summary

    7. Deploying Application in AWS, Azure, and Docker

    Prerequisites – deploying our application on Remote Server

    Setting up Tomcat server

    Deploying application in Docker container

    Deploying Application in AWS

    Deploying application in Microsoft Azure

    Self-test questions

    Summary

    8. Monitoring Infrastructure and Applications

    Getting started – monitoring

    Overview of Monitoring tools and Techniques

    Nagios

    Quick start with Nagios

    Monitoring AWS Elastic Beanstalk

    Monitoring Microsoft Azure Web App Service

    Self-test questions

    Summary

    9. Orchestrating Application Deployment

    Creating build jobs for end-to-end automation

    Configuring SSH authentication using a key

    Configuring the build pipeline for build job orchestration

    Executing the pipeline for application deployment automation

    Hygieia – a DevOps dashboard

    Self-test questions

    Summary

    DevOps for Web Development


    DevOps for Web Development

    Copyright © 2016 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: October 2016

    Production reference: 1171015

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham 

    B3 2PB, UK.

    ISBN 978-1-78646-570-2

    www.packtpub.com

    Credits

    About the Author

    Mitesh Soni is an avid learner with 9 years’ experience in the IT industry. He is an SCJP, SCWCD, VCP, and IBM Urbancode certified professional. He loves DevOps and cloud computing, and also has an interest in programming in Java. He finds design patterns fascinating. He occasionally contributes to http://etutorialsworld.com. He loves to play with kids, fiddle with his camera, and capture photographs at Indroda Park. He is addicted to taking good pictures without knowing many technical details. He lives in the capital of Mahatma Gandhi's home state.

    Acknowledgments

    To my...wife? (I am not married.)

    And my...children? (Read the previous sentence.)

    ...without whom this book has been completed within 3-4 months. (Else it might have taken a year or two—pun intended!)

    On a serious note, I would like to dedicate this book to the kid who taught me to live life freely. Shreyu (Shreyansh, my sister Jigisha's baby boy) showed me the power of innocence and smiles. I've had a completely different perspective of life since he has arrived.

    Special thanks to Priyanka Agashe for supporting and encouraging me all the time. Please don't overrate me as a person (all sisters do that). Sorry for being khadoos. I would also like to dedicate this book to my father, who is an avid reader. He loves books so much that he reads these technical books and notes down all the quotes at the beginning of each chapter. I want to say thanks and share my gratitude for everything I've been blessed with.

    I would like to thank my parents, Jigisha and Nitesh, dada and dadi, Vinay Kher, my teachers, friends, family members, Aakanksha Akkus Deshpande (thanks Mother India for always telling me "koshish karne valo ki haar nahi hoti"), Hemant and Priyanka, Mihir P and Anupama S, Yohan Wadia, Jyoti-Kanika Bhatia (you always remember special occasions Jyotiben), Rohini Gaonkar, Rohan C, Mayur Mothliya, Chintan Solaki, Navrang O, Dharmesh R, and Ashish B.

    I am also thankful to Palak S, Subhrajyoti M, Siddharth B, Nirali Kotak, Sumukh, Bijal, Ragni, Beena, Arpan V, Parth S, Bibhas S, Paresh P, Nirav V, Vimal K, Paras Shah, Vishal R, Sharvil P, Sourabh M, Viral I, Vijay Y, Amit R, Manisha Y, Gowri, Saurabh S, Nishchal S, and Kushal V, who have always helped me and made my life easier at specific points in the past year or so. I'm not sure we will ever meet again in life, so I'm trying to thank all those who helped me, knowingly or unknowingly. Apologies if I have missed any names.

    About the Reviewer

    Allan Espinosa is a DevOps practitioner living in Tokyo. He is an active open source contributor to various distributed systems tools, such as Docker and Chef. He maintains several Docker images for popular open source software that were popular even before the official release from the upstream open source groups themselves. In his career, Allan has worked on large distributed systems containing hundreds to thousands of servers in production. He has built scalable applications on various platforms, ranging from large supercomputing centers in the US to production enterprise systems in Japan. Allan can be contacted through his Twitter handle @AllanEspinosa. His personal website at http://aespinosa.github.io contains several blog posts on Docker and distributed systems in general.

    I would like to thank my wife, Kana, for her continuous support, which allowed me to spend significant time with this review project.

    www.PacktPub.com

    For support files and downloads related to your book, please visit www.PacktPub.com.

    Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.

    At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

    https://www.packtpub.com/mapt

    Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

    Why subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print, and bookmark content

    On demand and accessible via a web browser

    Preface

    DevOps is part of almost every discussion in the project team, sales team, customer engagements, and so on. Yes, it is a Culture but customers are asking for Proof of Concepts of automation that can be utilized in the Application Life Cycle Management. Even though DevOps is in early stage and it is about changing the existing culture that invites resistance, still it is wise to follow what Socrates said:

    The secret of change is to focus all your energy not on fighting the old, but on building the new.

    The reason behind the culture shift is to keep pace with evolution with ongoing revolution, innovations, and business demands in the highly dynamic and competitive market.

    Main objective is to manage frequent releases effectively. The faster you fail, the faster you recover. To fail early is far better than to fail at the end of the phase where roll back is very difficult. By automating repetitive processes, you standardized the management of application lifecycle and avoid error prone manual processes.

    In this book, we will cover all the key components of DevOps such as Continuous Integration, Cloud Computing, Configuration Management, Continuous Delivery, and Continuous Deployment; how to automate build integration, provision resources in cloud environment such as AWS and Microsoft Azure, use containers for application deployment, use Chef configuration management tool to set up runtime environment for application deployment; deploying web application into virtual machines configured with Chef, AWS Elastic Beanstalk, Microsoft Azure Web Apps, and Docker containers; application monitoring with Nagios, New Relic, and Native Cloud Monitoring features as well.

    For Continuous Integration, we have used Jenkins 2. Orchestration of end to end automation is managed by Pipeline.

    Jenkins 2 is aimed to claim Continuous Delivery space also. It brings a new setup experience and interesting UI improvements, and Pipeline as code while maintaining backward compatibility with existing Jenkins installations.

    What this book covers

    Chapter 1, Getting Started–DevOps Concepts, Tools, and Technologies, gives insights into DevOps movement, challenges for developers team, challenges for operations team, challenges faced by organizations, waterfall and agile model, importance of collaboration, cloud computing, reason to go for DevOps, benefits of DevOps, DevOps lifecycle, build automation, continuous integration and its best practices, configuration management, continuous delivery and continuous deployment and its best practices, continuous monitoring, and continuous feedback. It also covers an overview of code repositories, Maven, Jenkins 2.0, Chef, AWS, Microsoft Azure, Docker, Nagios, Hygieia DevOps Dashboard, overview of Sample JEE application.

    Chapter 2, Continuous Integration with Jenkins 2, describes in details on overview of continuous integration, Jenkins 2.0 installation, Java and Maven configuration in Jenkins, creating and configuring build job for Java application with Maven, Dashboard View plugin, managing nodes, email notifications based on build status, and Jenkins and Sonar integration

    Chapter 3, Building the Code and Configuring the Build Pipeline, covers built-in delivery pipelines using a domain-specific language (DSL), Build Pipeline plugin, deploying a WAR file in the web server.

    Chapter 4, Installing and Configuring Chef, gives insight on Chef configuration management tool, hosted Chef, installing and configuring Chef workstation, and converging Chef node using Chef workstation.

    Chapter 5, Installing and Configuring Docker, covers overview of Docker container, understanding difference between virtual machines and containers, installation and configuration of Docker on CentOS, creating the first Docker container, and managing containers.

    Chapter 6, Cloud Provisioning and Configuration Management with Chef, gives insight into Chef and cloud provisioning, installing knife plugins for Amazon Web Services and Microsoft Azure, and creating and configuring virtual machine in Amazon Web Services and Microsoft Azure.

    Chapter 7, Deploying Application in AWS, Azure, and Docker, covers prerequisites—to deploy application on Remote Server, use tomcat manager app, deploying application in Tomcat Docker container, deploying application in AWS Elastic Beanstalk, and deploying application in Microsoft Azure web apps.

    Chapter 8, Monitoring Infrastructure and Applications, provides overview of monitoring, Nagios monitoring tool and quick start on it, installation of Nagios, configuring monitoring of AWS EC2 instance, AWS Elastic Beanstalk monitoring, Microsoft Azure web app service monitoring, Microsoft Azure application insights, and monitoring web application and Tomcat server with New Relic.

    Chapter 9, Orchestrating Application Deployment, describes in detail how to orchestrate different build jobs for continuous integration, configuration management, continuous delivery and so on. It will cover creating parameterized build jobs for end to end

    Enjoying the preview?
    Page 1 of 1