liveBook · Manning

Deployment pipeline

As explained in gRPC Microservices in Go

A CI/CD pipeline is an automated software-delivery workflow that integrates, tests, and prepares or deploys changes continuously.

A deployment pipeline automates the path from a service change to a deployable artifact. For Go gRPC microservices, that path can include generating code from .proto files, running quality checks, building Docker images, and deploying to Kubernetes. Automation reduces repetitive work across services, but a green job alone does not establish that a release is reliable. section 1.4.3 section 1.4

Separate the pipeline into checks and release steps:

  • Generate Go stubs when protocol definitions change; use repository events or version tags to trigger the job. section 1.4.3 section 3.3.2
  • Before trusting the main branch, use unit and integration tests, service contract tests, static analysis, and vulnerability checks. CI test output and coverage can also help verify pull requests. section 1.4.3 section 7.6
  • Tag a successful artifact, promote it through UAT to production, and choose a rollout method such as rolling, canary, or blue-green deployment. Monitor error rates and user feedback so a rollback or hotfix remains possible. section 1.4.3

Generate stubs for three services

A GitHub Actions workflow in .github/workflows runs when a version tag is pushed. Its matrix runs a generation script for the order, payment, and shipping services. The script installs protoc and Go generators, compiles each service’s .proto files, initializes its Go module, and pushes the generated source and tags for clients to consume. section 3.3.2

name: "Protocol Buffer Go Stubs Generation"
on:
  push:
    tags:
      - v**                                                                #1
jobs:
  protoc:
    name: "Generate"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        service: ["order", "payment", "shipping"]                          #2
    steps:
      - name: Install Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.17
      - uses: actions/checkout@v2
      - name: Etract Release Version
        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV   #3
      - name: "Generate for Golang"
        shell: bash
        run: |
          chmod +x "${GITHUB_WORKSPACE}/run.sh"                            #4
          ./run.sh ${{ matrix.service }} ${{ env.RELEASE_VERSION }}        #5

The workflow listing shows the tag trigger, three-service matrix, Go setup, and invocation of the generation script. section 3.3.2

How gRPC Microservices in Go covers it

How deep it goes
Details a tagged, matrix-based stub-generation workflow and recommends release checks and rollout methods, without specifying a complete deployment job.
Examples
Uses a GitHub Actions workflow and Bash script to generate tagged Go stubs for order, payment, and shipping services.
What it assumes
Assumes familiarity with Go services and repositories; points readers new to GitHub Actions toward its Quickstart.
What you can do after
Operate/configure it to generate versioned service stubs, verify changes, and plan artifact promotion with rollback readiness.
How it connects
Links Protocol Buffers, gRPC code generation, unit testing, integration testing, contract testing, Docker images, Kubernetes, monitoring, and rollback.

Also explained in

Compare how 30 books explain deployment pipeline →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.