O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Continuous Delivery in Java

Book Description

With Early Release ebooks, you get books in their earliest form—the author's raw and unedited content as he or she writes—so you can take advantage of these technologies long before the official release of these titles. You'll also receive updates when significant changes are made, new chapters are available, and the final ebook bundle is released.

Continuous delivery adds enormous value to the business and the entire software delivery lifecycle by encouraging fast feedback and automation of the quality assurance and deployment processes. But adopting continuous delivery means mastering new skills typically outside of a developer’s comfort zone, such as architectural design, automated functional and system quality attribute testing, and the ability to package and deploy applications onto a variety of platforms.

In this practical book, author Daniel Bryant explores each of these skills and provides guidance to help you master them. You’ll not only learn how to create a comprehensive build pipeline for continually delivering effective software, you’ll also explore how Java application architecture and deployment platforms have affected the way we rapidly safely deliver new software to production environments.

  • Design architecture for continuously delivering Java applications
  • Build modern application artifacts: Fat JARs, virtual machine images, operating system containers, and serverless packages
  • Explore continuous integration (CI), including working effectively with DVCSs like Git, automating code reviews, and creating a build pipeline
  • Create a comprehensive build pipeline and design software that allows the separation of the deploy and release processes to improve delivery velocity
  • Learn why functional and system quality attribute testing starts with local development practices and continues right through delivery
  • Continue to observe your system once it’s running in production
  • Get advice for beginning or completing your migration to continuous delivery

Table of Contents

  1. Preface
    1. Why Did I Write This Book?
    2. Conventions Used in This Book
    3. Using Code Examples
    4. O’Reilly Safari
    5. How to Contact Us
    6. Acknowledgments
  2. 1. Why Continuous Delivery?
    1. Continuous Delivery Overview
    2. Enabling Developers
      1. Rapid Feedback Reduces Context Switching
      2. Automatic, Repeatable and Reliable Releases
      3. Codifying the “Definition of Done”
    3. Requirements of Modern Java Architecture
      1. Need for Business Speed and Stability
      2. Rise of the API Economy
      3. Opportunities and Costs of the Cloud
      4. Modularity Redux: Embracing Small Services
      5. Requirements, Architecture and Continuous Delivery
    4. Evolution of Java Deployment Platforms
      1. WARs and EARs: The Era of Application Server Dominance
      2. Executable Fat JARs: Emergence of Twelve Factor Apps
      3. Container Images: Increasing Portability (and Complexity)
      4. Functions as-a-Service (FaaS): The Emergence of “Serverless”
      5. Impact of Platforms on Continuous Delivery
    5. DevOps, SRE, and Release Engineering
      1. Development and Operations (DevOps)
      2. Site Reliability Engineering (SRE)
      3. Release Engineering
      4. Shared Responsibility, Metrics and Observability
    6. Exploring a Typical Build Pipeline
    7. Summary
  3. 2. Designing Architecture for Continuous Delivery
    1. Fundamentals of Good Architecture
      1. Loose Coupling
      2. High Cohesion
      3. Coupling, Cohesion and Continuous Delivery
    2. Architecture for Business Agility
      1. Bad Architecture Limits Business Velocity
      2. Complexity and Cost of Change
    3. Best Practices for API-Driven Applications
      1. Build APIs “Outside-In”
      2. Good APIs Assist Continuous Testing and Delivery
    4. Deployment Platforms and Architecture
      1. Designing Cloud-Native “Twelve Factor" Applications
      2. Cultivating “Mechanical Sympathy”
      3. Design and Continually Test for Failure
    5. The Move Towards Small Services
      1. Challenges for Delivering Monolithic Applications
      2. Microservices: SOA Meets Domain-Driven Design
      3. Functions, Lambdas, and Nanoservices
    6. Architecture: “The Stuff That’s Hard to Change”
    7. Summary
  4. 3. Deployment Platforms, Infrastructure and Continuous Delivery of Java Apps
    1. Functionality Provided by a Platform
    2. Essential Development Processes
    3. Traditional Infrastructure Platforms
      1. Traditional Platform Components
      2. Challenges with Traditional Infrastructure Platforms
      3. Benefits of Being Traditional
      4. CI/CD on Traditional Infrastructure Platforms
    4. Cloud (IaaS) Platform
      1. Looking Inside the Cloud
      2. Cloud Challenges
      3. Benefits of Cloud
      4. Continuously Delivering into the Cloud
    5. Platform-as-a-Service (PaaS)
      1. Peeking Inside a PaaS
      2. PaaS Challenges
      3. Benefits of PaaS
      4. CI/CD and PaaS
    6. Containers (Docker)
      1. Container Platform Components
      2. Container Challenges
      3. Container Benefits
      4. Continuously Delivering Containers
    7. Kubernetes
      1. Core Concepts of Kubernetes
      2. Kubernetes Challenges 
      3. Benefits of Kubernetes
      4. Continuous Delivery on Kubernetes
    8. AWS Lambda “Serverless”
      1. Serverless Concepts (Yes, There Are Servers!)
      2. Challenges of Serverless
      3. Serverless Benefits
      4. CI/CD and Serverless
    9. Working with Infrastructure as Code (IaC)
    10. Summary
  5. 4. Building Java Applications
    1. Breaking Down the Build Process
    2. Automating the Build
      1. Build Dependencies
      2. External Dependencies
      3. Multi-module Projects
      4. Multiple Repositories (or a Monorepo)?
      5. Plugins
      6. Releasing and Publishing Artifacts
    3. Java Build Tooling Overview
      1. Ant
      2. Maven
      3. Gradle
      4. Bazel, Pants and Buck
      5. Other JVM Build Tools: SBT and Leiningen
      6. make
    4. Choosing a Build Tool
    5. Summary
  6. 5. Additional Build Tooling and Skills
    1. Linux, Bash and Basic CLI Commands
      1. Users, Permissions and Groups
      2. Working with the Filesystem
      3. Viewing and Editing Text
      4. Joining Everything Together: Redirects, Pipes and Filters
      5. Searching and Manipulating Text: grep, AWK and sed
      6. Diagnostic Tooling: top, ps, netstat and iostat
    2. HTTP Calls and JSON Manipulation
      1. curl
      2. HTTPie
      3. jq
    3. Basic Scripting
      1. xargs
      2. Pipes and Filters
      3. Loops
      4. Conditionals
    4. Summary
  7. 6. Packaging Applications For Deployment
    1. Building a JAR: Step-by-Step
    2. Building a Fat Executable “Uber" JAR
      1. Maven Shade Plugin
      2. Building Spring Boot Uber JARs
    3. Skinny JARs - Deciding Not to Build Fat JARs
    4. Building WAR files
    5. Packaging for the Cloud
      1. Building RPMs and DEBs OS Packages
      2. Additional OS Package Build Tools (with Windows Support)
      3. Creating Machine Images for Multiple Clouds with Packer
      4. Additional Machine Image Creation Tools
    6. Building Containers
      1. Creating Container Images with Docker
      2. Fabricating Docker Images with Fabric8
    7. Packaging Serverless Java Applications
    8. Summary
  8. 7. Working Locally (Like it was Production)
    1. Challenges with Local Development
    2. Mocking, Stubbing and Service Virtualisation
      1. Pattern #1: Profiles, Mocks and Stubs
      2. Mocking with Mockito
      3. Pattern #2: Service Virtualisation and API Simulation
      4. Virtualising Services with Hoverfly
    3. VMs: Vagrant and Packer
      1. Installing Vagrant
      2. Creating a Vagrantfile
      3. Pattern #3: Production-in-a-Box
    4. Containers: Kubernetes, minikube and Telepresence
      1. Introducing the “Docker Java Shop” Sample App
      2. Building Java Applications and Container Images
      3. Deploying into Kubernetes
      4. Simple Smoke Test
      5. Building the Remaining Applications
      6. Deploying the Entire Java Application in Kubernetes
      7. Viewing the Deployed Application
      8. Telepresence: Working Remotely, Locally
      9. Pattern #4: Environment Leasing
    5. Serverless: AWS Lamba and SAM Local
      1. Installing
      2. Serverless Scaffolding
      3. Smoke Test
    6. Summary
  9. 8. Migrating to Continuous Delivery
    1. Understand Your “Habitat”
      1. The Cynefin Framework and Continuous Delivery
      2. All Models are Wrong, Some are Useful
    2. Start Small, Experiment, Learn, Repeat
    3. Increase Adoption
    4. Bad Practices and Common Anti-Patterns
    5. Ugly Architecture: To Fix, or Not to Fix
    6. Summary: The Socio-technical System
  10. 9. Continuous Delivery and Continuous Improvement
    1. Our First Priority: Continuous Delivery of Valuable Software
    2. Increasing Shared Responsibility of Software
    3. Codifying Expectations Provides Clarity
    4. Automation is a Multiplying Effect 
    5. Do Not Underestimate the Power of Fast Feedback and Experimentation
    6. Expanding Continuous Delivery Throughout an Organisation
    7. Conclusion: Continuous Improvement and Software Delivery