Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction of CI/CD

Avatar for Paggie Chen Paggie Chen
September 07, 2023

Introduction of CI/CD

Avatar for Paggie Chen

Paggie Chen

September 07, 2023

Other Decks in Technology

Transcript

  1. What is CI/CD? • A method to frequently deliver apps

    to customers by introducing automation into the stages of app development. • CI/CD is a solution to the problems integrating new code can cause for development and operations teams (AKA "integration hell"). https://www.redhat.com/en/topics/devops/what-is-ci-cd#:~:text=CI%2FCD%20is%20a%20method,continuous%20delivery%2C%20and%20continuous%20deployment.
  2. What is Continuous Integration (CI) ? Developers merge their changes

    back to the main branch as often as possible, in order to check that the application is not broken whenever new commits are integrated into the main branch. Solution for: Software systems are complex, and an apparently simple, self-contained change to a single file can have unintended side effects on the overall system. When a large number of developers work on related systems, coordinating code updates is a hard problem, and changes from different developers can be incompatible. Benefits: research (PDF) shows that it leads to higher deployment frequency, more stable systems, and higher quality software. DevOps tech: Continuous integration | DevOps capabilities | Google Cloud
  3. Principles: • Work in Small batches. The practice of trunk-based

    development in which developers work off trunk/mainline in small batches. They merge their work into a shared trunk/mainline at least daily, rather than working on long-lived feature branches. • Fixing bugs is the top priority. An agreement that when the build breaks, fixing it should take priority over any other work. Key elements of a successful CI implementaion: • Each commit should trigger a build of the software. • Each commit should trigger a series of automated tests that provide feedback in a few minutes. “If something takes a lot of time and energy, you should do it more often, forcing you to make it less painful.”
  4. To implement successful CI, you need: • An automated build

    process. The first step in CI is having an automated script that creates packages that can be deployed to any environment. The packages created by the CI build should be authoritative and used by all downstream processes. These builds should be numbered and repeatable. You should run your build process successfully at least once a day. • A suite of automated tests. Your tests should run successfully at least once a day. • A CI system that runs the build and automated tests on every check-in. The system should also make the status visible to the team. Don't use email notifications.
  5. What is Continuous Delivery (CD) ? • Automatically deploys all

    code changes to a testing environment after the build stage. • This means that on top of automated testing, you have an automated release process and you can deploy your application any time by clicking a button.
  6. What is Continuous Deployment (CD) ? • There isn’t a

    release day anymore. • No human intervention. • Works well for web services, but can't be applied to software such as firmware (韌體) or mobile apps.
  7. Continuous Delivery vs Continuous Deployment • Continuous delivery: automates deployment

    of a release to a staging or testing environment • continuous deployment: automates deployment of every release to production (after it passes through your pipeline, including testing).
  8. Common CI/CD tools • Jenkins: one of the best known

    open source tools for CI/CD, is designed to handle anything from a simple CI server to a complete CD hub. • Spinnaker: a CD platform built for multi-cloud environments.
  9. Cloud Build With Cloud Build, you can connect your application

    source code to your build configuration, and Cloud Build will automatically build and test your application every time you make changes to your code. You can also configure Cloud Build to deploy your application to a cloud-based platform or to an on-premises environment once the build is complete.
  10. Lab: Continuous Deployment to GKE with Cloud Build In this

    lab, you'll learn to set up a continuous delivery pipeline for GKE with Cloud Build. This lab highlights how to trigger Cloud Build jobs for different git events as well as a simple pattern for automated canary releases in GKE. You'll complete the following steps: • Create the GKE Application • Automate deployments for git branches • Automate deployments for git main branch • Automate deployments for git tags https://codelabs.developers.google.com/codelabs/cloud-builder-gke-continuous-deploy#0
  11. DevOps Research and Assessment (DORA) DevOps Research and Assessment (DORA)

    is a long running research program that seeks to understand the capabilities that drive software delivery and operations performance. DORA helps teams apply those capabilities, leading to better organizational performance. Parent organizations: Google, Alphabet Inc. Founded: 2015
  12. We've outlined the DevOps practices that drive successful software delivery

    and operational performance, with a deep focus on security for the 2022 report. What you’ll learn: • How your organization compares to others in the industry based on 5 key metrics • How cultural changes can improve supply chain security • Why high-trust and low-blame cultures tend to have higher organizational performance 2022 State of DevOps Report | Google Cloud DORA 2022 Accelerate State of DevOps Report now out | Google Cloud Blog
  13. References Continuous integration vs. delivery vs. deployment What is CI/CD?.

    CI/CD with Google Cloud Continuous deployment to Google Kubernetes Engine (GKE) with Cloud Build (codelab) 2022 State of DevOps Report | Google Cloud DORA 2022 Accelerate State of DevOps Report now out | Google Cloud Blog