售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Setting Up the Environment
Introducing Continuous Delivery
Understanding CD
The traditional delivery process
Introducing the traditional delivery process
Shortcomings of the traditional delivery process
Benefits of CD
Success stories
The automated deployment pipeline
Continuous Integration (CI)
Automated acceptance testing
The Agile testing matrix
The testing pyramid
Configuration management
Prerequisites to CD
Organizational prerequisites
DevOps culture
Client in the process
Business decisions
Technical and development prerequisites
Building the CD process
Introducing tools
Docker ecosystem
Jenkins
Ansible
GitHub
Java/Spring Boot/Gradle
The other tools
Creating a complete CD system
Introducing Docker
Configuring Jenkins
The CI pipeline
Automated acceptance testing
Clustering with Kubernetes
Configuration management with Ansible
The CD pipeline/advanced CD
Summary
Questions
Further reading
Introducing Docker
Technical requirements
What is Docker?
Containerization versus virtualization
The need for Docker
Environment
Isolation
Organizing applications
Portability
Kittens and cattle
Alternative containerization technologies
Installing Docker
Prerequisites for Docker
Installing on a local machine
Docker for Ubuntu
Docker for Windows, macOS, and Linux
Testing the Docker installation
Installing on a server
Dedicated server
Running Docker hello world
Docker components
Docker client and server
Docker images and containers
Docker applications
Building images
Docker commit
Dockerfile
Completing the Docker application
Writing the application
Preparing the environment
Building the image
Running the application
Environment variables
Docker container states
Docker networking
Running services
Container networks
Exposing container ports
Automatic port assignment
Using Docker volumes
Using names in Docker
Naming containers
Tagging images
Docker cleanup
Cleaning up containers
Cleaning up images
Docker commands overview
Summary
Exercises
Questions
Further reading
Configuring Jenkins
Technical requirements
What is Jenkins?
Installing Jenkins
Requirements for installation
Installing Jenkins on Docker
Installing without Docker
Initial configuration
Jenkins in the cloud
Jenkins Hello World
Jenkins architecture
Master and slaves
Scalability
Vertical scaling
Horizontal scaling
Test and production instances
Sample architecture
Configuring agents
Communication protocols
Setting agents
Permanent agents
Configuring permanent agents
Understanding permanent agents
Permanent Docker agents
Configuring permanent Docker agents
Understanding permanent Docker agents
Jenkins Swarm agents
Configuring Jenkins Swarm agents
Understanding Jenkins Swarm agents
Dynamically provisioned Docker agents
Configuring dynamically provisioned Docker agents
Understanding dynamically provisioned Docker agents
Testing agents
Custom Jenkins images
Building the Jenkins slave
Building the Jenkins master
Configuration and management
Plugins
Security
Backup
The Blue Ocean UI
Summary
Exercises
Questions
Further reading
Section 2: Architecting and Testing an Application
Continuous Integration Pipeline
Technical requirements
Introducing pipelines
The pipeline structure
Multi-stage Hello World
The pipeline syntax
Sections
Directives
Steps
The commit pipeline
Checkout
Creating a GitHub repository
Creating a checkout stage
Compile
Creating a Java Spring Boot project
Pushing code to GitHub
Creating a compile stage
Unit tests
Creating business logic
Writing a unit test
Creating a unit test stage
Jenkinsfile
Creating the Jenkinsfile
Running the pipeline from Jenkinsfile
Code-quality stages
Code coverage
Adding JaCoCo to Gradle
Adding a code coverage stage
Publishing the code coverage report
Static code analysis
Adding the Checkstyle configuration
Adding a static code analysis stage
Publishing static code analysis reports
SonarQube
Triggers and notifications
Triggers
External
Polling SCM
Scheduled builds
Notifications
Group chats
Team spaces
Team development strategies
Development workflows
The trunk-based workflow
The branching workflow
The forking workflow
Adopting Continuous Integration
Branching strategies
Feature toggles
Jenkins multi-branch
Non-technical requirements
Summary
Exercises
Questions
Further reading
Automated Acceptance Testing
Technical requirements
Introducing acceptance testing
Docker registry
The artifact repository
Installing Docker registry
Docker Hub
Private Docker registry
Installing the Docker registry application
Adding a domain certificate
Adding an access restriction
Other Docker registries
Using Docker registry
Building an image
Pushing the image
Pulling the image
Acceptance tests in the pipeline
The Docker build stage
Adding Dockerfile
Adding the Docker build to the pipeline
The Docker push stage
The acceptance testing stage
Adding a staging deployment to the pipeline
Adding an acceptance test to the pipeline
Adding a cleaning stage environment
Writing acceptance tests
Writing user-facing tests
Using the acceptance testing framework
Creating acceptance criteria
Creating step definitions
Running an automated acceptance test
Acceptance test-driven development
Summary
Exercises
Questions
Further reading
Clustering with Kubernetes
Technical requirements
Server clustering
Introducing server clustering
Introducing Kubernetes
Kubernetes features overview
Kubernetes installation
The Kubernetes client
The Kubernetes server
The local environment
Minikube
Docker Desktop
Cloud platforms
On-premise
Verifying the Kubernetes setup
Using Kubernetes
Deploying an application
Deploying Kubernetes Service
Exposing an application
Advanced Kubernetes
Scaling an application
Updating an application
Rolling updates
Kubernetes objects and workloads
Application dependencies
The Kubernetes DNS resolution
Multi-application system overview
Multi-application system implementation
Adding the Hazelcast client library to Gradle
Adding the Hazelcast cache configuration
Adding Spring Boot caching
Building a Docker image
Multi-application system testing
Scaling Jenkins
Dynamic slave provisioning
Jenkins Swarm
Comparing dynamic slave provisioning and Jenkins Swarm
Alternative cluster management systems
Docker Swarm
Apache Mesos
Comparing features
Summary
Exercises
Questions
Further reading
Section 3: Deploying an Application
Configuration Management with Ansible
Technical requirements
Introducing configuration management
Traits of good configuration management
Overview of configuration management tools
Installing Ansible
Ansible server requirements
Ansible installation
The Docker-based Ansible client
Using Ansible
Creating an inventory
Ad hoc commands
Playbooks
Defining a playbook
Executing the playbook
The playbook's idempotency
Handlers
Variables
Roles
Understanding roles
Ansible Galaxy
Deployment with Ansible
Installing Hazelcast
Deploying a web service
Changing the Hazelcast host address
Adding calculator deployment to the playbook
Running the deployment
Ansible with Docker and Kubernetes
Benefits of Ansible
The Ansible Docker playbook
Installing Docker
Running Docker containers
The Ansible Kubernetes playbook
Summary
Exercises
Questions
Further reading
Continuous Delivery Pipeline
Technical requirements
Environments and infrastructure
Types of environment
Production
Staging
QA
Development
Environments in Continuous Delivery
Securing environments
Nonfunctional testing
Types of nonfunctional test
Performance testing
Load testing
Stress testing
Scalability testing
Endurance testing
Security testing
Maintainability testing
Recovery testing
Nonfunctional challenges
Application versioning
Versioning strategies
Versioning in the Jenkins pipeline
Completing the Continuous Delivery pipeline
Inventory
Versioning
Remote staging environment
Acceptance testing environment
Release
Smoke testing
Complete Jenkinsfile
Summary
Exercises
Questions
Further reading
Advanced Continuous Delivery
Technical requirements
Managing database changes
Understanding schema updates
Introducing database migrations
Using Flyway
Configuring Flyway
Defining the SQL migration script
Accessing database
Changing database in Continuous Delivery
Backwards-compatible changes
Non-backwards-compatible changes
Adding a new column to the database
Changing the code to use both columns
Merging the data in both columns
Removing the old column from the code
Dropping the old column from the database
Separating database updates from code changes
Avoiding shared database
Preparing test data
Unit testing
Integration/acceptance testing
Performance testing
Pipeline patterns
Parallelizing pipelines
Reusing pipeline components
Build parameters
Shared libraries
Creating a shared library project
Configure the shared library in Jenkins
Using the shared library in Jenkinsfile
Rolling back deployments
Adding manual steps
Release patterns
Blue-green deployment
Canary release
Working with legacy systems
Automating build and deployment
Automating tests
Refactoring and introducing new features
Understanding the human element
Summary
Exercises
Questions
Further reading
Best practices
Practice 1 – own process within the team!
Practice 2 – automate everything!
Practice 3 – version everything!
Practice 4 – use business language for acceptance tests
Practice 5 – be ready to roll back
Practice 6 – don't underestimate the impact of people
Practice 7 – build in traceability
Practice 8 – integrate often
Practice 9 – only build binaries once
Practice 10 – release often
Assessment
Chapter 1: Introducing Continuous Delivery
Chapter 2: Introducing Docker
Chapter 3: Configuring Jenkins
Chapter 4: Continuous Integration Pipeline
Chapter 5: Automated Acceptance Testing
Chapter 6: Clustering with Kubernetes
Chapter 7: Configuration Management with Ansible
Chapter 8: Continuous Delivery Pipeline
Chapter 9: Advanced Continuous Delivery
Other Books You May Enjoy
Leave a review - let other readers know what you think
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜