1 Related Concepts

1.1 Continuous integration CI

Agile development solves the problem of single application development and daily build. Single applications are divided into microservices. The complexity of application deployment in microservice mode is high, so new methods are needed to assemble these microservices into microservice architectures that can be jointly operated. Continuous integration supports the assembly of microservices.

Continuous integration is a software development practice, help team members integration work frequently, usually each project integration at least once a day, every day to generate testable versions of each integration using automated build/test implementation packaging and testing, validation issues quickly and continuous integration can effectively reduce the error encountered in the process of integration of, Enables teams to develop software more quickly.

Automated testing makes it possible to verify the correct working ability of a module after its functions are integrated together. Different modules can be integrated and tested in a class production environment through joint testing environment.

1.2 Continuous Deployment of the CD

Software deployment is the deployment of software to the desired path on the target machine according to the desired state. Continuous deployment is the automatic deployment of one or more software to the target machine as fast, stable and repeatable as possible for the verification and operation of software functions. This could be automatic deployment in the cloud, APP upgrades, website updates, or just updating the list of available versions.

The key to continuous deployment is automated deployment, which is often implemented using Ansible. With Spring Cloud Config, the application and configuration can be separated. Building at one time and running in multiple places, Spring Cloud Actuator provides interfaces for application health monitoring.

1.3 the difference between

Differences in related concepts:

  • DevOps= Plan + code + build + test + release + deploy + operations
  • Continuous deployment = Planning + code + build + test + release + deploy
  • Continuous delivery = plan + code + build + test + release
  • Continuous integration = Planning + code + build + test
  • Agile = Plan + code + build

1.3 Releasing the Deployment Mode

1.3.1 Bluish Green Release

Blue green maintenance for two of the same host environment, an environment for the blue production, is a pre-release environment, green said before the instance is a scheduling system, ACTS as a product or application client gateway, through an example of scheduling system toward the blue or green can be customer traffic flow to the expectations of the deployment environment, in this way to switch to the deployment of instances.

1.3.2 Canary deployment

A portion of the customer traffic is re-diverted to the new release deployment for testing in production. If the new release is fine, more traffic is diverted and, over time, incrementally deployed until 100% of the traffic is scheduled to the new release.

1.3.3 Function Switch

For new features may need to turn off easily, developers can add function switch, switch in the code the if – then software function, data values when enabled only in the new code, the data values can be globally accessible location, deployed application to check if the location shall implement the new code, if set the data value, code is executed, If not, do not execute. This provides developers with a remote kill switch to turn off new functionality if problems are found after deployment to production.

2 the conversation process

2.1 Agile Development

  1. Requirements Management: Jira
    • Release is in months
    • The Spring unit is weeks
    • Issue problem
      • Epic
      • Story
      • Task
      • Bug
  2. Jira plug-ins can be used to associate Jira servers in IDEA

2.2 Microservice Architecture

  1. Springboot: Web application
  2. SpringCloud: Registry, gateway, service governance

2.3 Continuous Integration

  1. Build: Maven:
    • snapshot
    • Release
  2. Integration: Jenkins
  3. Artifact library: Artifactory Open Source edition

2.4 Continuous testing

  1. Unit tests: JUnit
  2. Code static scan: Sonarqube
  3. Interface automation test: YAPI
  4. UI automation testing: Selenium

2.5 Containerization: Docker

  1. Process isolation: Namespace
  2. Resource isolation: CGroups
  3. Docker image: joint mount
  4. Dockerfile
  5. Mirror repository: JFrog Container Registery

2.6 Kubernetes

  1. Operating environment: Minikube
  2. Core concepts: Pod, Service, Deployment, key, PV/PVC, Probe
  3. Application release: Helm

3 Gitflow

  • Master: Always be ready for production deployment
  • Develop: Contains all the latest, releasable changes also known as integration branches. When publishing from develop to Release, change the merged master branch.
  • The feature branch may be created based on Develop and must be merged back to Develop. It cannot be named master, Develop, Release -*, or hotfix-*.
  • Supporting branches:
    • Hotfix branch: may be created on master and must be merged back to Develop, master, and named Hotfix -*