🔄 Building a CI/CD Pipeline Diagram

A comprehensive, step-by-step guide to creating a professional DevOps architecture diagram using Privacy Sketch. Perfect for documentation, presentations, and team communication.

15 min read Intermediate Architecture Diagrams

What You'll Build

In this tutorial, you'll create a complete CI/CD (Continuous Integration/Continuous Delivery) pipeline diagram that shows the flow from code commit to production deployment. By the end, you'll have a beautiful, hand-drawn style diagram that's perfect for:

CI/CD Pipeline Diagram Preview
The final CI/CD pipeline diagram you'll create

Understanding the Structure

Before we start building, let's break down what makes a good CI/CD diagram. Our pipeline will have four main stages:

Stage Color Purpose
DEV Blue Where developers write and commit code
CI (Build) Green Automated testing, linting, and artifact creation
CD (Deploy) Amber/Orange Staging deployment and integration tests
Production Purple Live environment with monitoring

Design Principle: Color Coding

Using consistent colors for each stage makes your diagram scannable at a glance. Viewers can quickly identify which part of the pipeline they're looking at.

Step 1: Create the Canvas Background

Every great diagram starts with a solid foundation. We'll create a dark background that makes our colorful stages pop.

1

Add the Background Rectangle

Open Privacy Sketch and create a large rectangle that will serve as your canvas. This gives the diagram a cohesive look and provides contrast for the lighter elements.

{
  "id": "bg",
  "type": "rectangle",
  "x": 20,
  "y": 20,
  "w": 1300,
  "h": 600,
  "options": {
    "stroke": "#0f172a",
    "fill": "#1e293b",
    "fillStyle": "solid",
    "roughness": 1.8
  }
}

Key settings explained:

Step 2: Add the Title and Subtitle

A clear title immediately tells viewers what they're looking at. We'll add a main title and a descriptive subtitle.

2

Create the Title Text

Text elements in Privacy Sketch can include emojis, which add visual interest. The options.stroke property sets the text color.

{
  "id": "title",
  "type": "text",
  "x": 350,
  "y": 40,
  "w": 600,
  "h": 35,
  "text": "🔄 CI/CD Pipeline Architecture",
  "fontSize": 28,
  "fontWeight": "bold",
  "align": "center",
  "options": {
    "stroke": "#e2e8f0"  // Light color for dark background
  }
}

Text Color Tip

For text elements, the options.stroke property sets the text color, not the border. This is different from shapes where stroke is the border color.

Step 3: Build the Stage Containers

Now for the main structure. We'll create four colored rectangles to represent each stage of the pipeline. Each stage has:

3

Create the DEV Stage (Blue)

The DEV stage represents the developer's workspace - GitHub repo, commits, and pull requests.

// Stage background
{
  "id": "stage-dev",
  "type": "rectangle",
  "x": 40,
  "y": 110,
  "w": 220,
  "h": 480,
  "borderRadius": 15,
  "options": {
    "stroke": "blue.500",
    "fill": "#172554",
    "fillStyle": "solid"
  }
}

// Stage label
{
  "id": "stage-dev-label",
  "type": "text",
  "x": 40,
  "y": 125,
  "w": 220,
  "h": 25,
  "text": "💻 DEV",
  "fontSize": 16,
  "fontWeight": "bold",
  "align": "center",
  "options": { "stroke": "blue.400" }
}

Tailwind Color Tokens: Notice we're using blue.500 and blue.400. Privacy Sketch supports Tailwind-style color tokens like red.500, green.700, etc.

Repeat for Other Stages

Following the same pattern, create the remaining three stages. Each stage is positioned to the right of the previous one:

Stage x position Width Border Color Fill Color
DEV 40 220 blue.500 #172554
CI 280 280 green.500 green.900
CD 580 280 amber.500 amber.900
PROD 880 420 #8b5cf6 #4c1d95

Step 4: Add Internal Components

Within each stage, we add specific components. Let's add the GitHub box and some action items in the DEV stage.

4

Create Component Cards

Each component is a smaller rounded rectangle with an icon (emoji) and label. We position them inside their parent stage.

// GitHub component box
{
  "id": "github",
  "type": "rectangle",
  "x": 60,
  "y": 170,
  "w": 180,
  "h": 80,
  "borderRadius": 12,
  "options": {
    "stroke": "#6e7681",
    "fill": "#21262d",
    "fillStyle": "solid"
  }
}

// GitHub icon (emoji)
{
  "id": "github-icon",
  "type": "text",
  "x": 60,
  "y": 185,
  "w": 180,
  "h": 30,
  "text": "🐙",
  "fontSize": 28,
  "align": "center"
}

// GitHub label
{
  "id": "github-label",
  "type": "text",
  "x": 60,
  "y": 220,
  "w": 180,
  "h": 20,
  "text": "GitHub Repo",
  "fontSize": 14,
  "fontWeight": "bold",
  "align": "center",
  "options": { "stroke": "#e6edf3" }
}

Z-Order Matters!

Elements are drawn in the order they appear in the array. Place background elements FIRST, then place child elements AFTER. Otherwise, parents will cover their children.

Step 5: Connect with Arrows

Arrows show the flow of work through the pipeline. This is where many people get confused, so let's break it down clearly.

5

Understanding Arrow Positioning

Arrows use x, y, w, h slightly differently than shapes:

To draw an arrow pointing right, use positive w and h: 0.

// Arrow from DEV to CI stage
{
  "id": "arrow-dev-to-ci",
  "type": "arrow",
  "x": 240,      // Right edge of DEV stage
  "y": 400,      // Vertical center
  "w": 50,       // Distance to CI stage
  "h": 0,        // Same height (horizontal arrow)
  "endArrowhead": "arrow",
  "options": {
    "stroke": "green.400",
    "strokeWidth": 2
  }
}

Arrow Direction Cheat Sheet

Direction w value h value Example
→ Right positive (+100) 0 Horizontal flow
← Left negative (-100) 0 Feedback loops
↓ Down 0 positive (+100) Vertical flow
↗ Diagonal positive negative Upward branch

Step 6: Add Decision Points

Diamonds are perfect for showing decision points in your flow, like "Does the build pass?"

6

Create a Diamond for Triggers

{
  "id": "trigger",
  "type": "diamond",
  "x": 305,
  "y": 180,
  "w": 80,
  "h": 60,
  "options": {
    "stroke": "green.500",
    "fill": "green.800",
    "fillStyle": "solid"
  }
}

Step 7: Final Touches

Polish your diagram with these finishing touches:

Pro Tip: Use Consistent Seeds

Add a "seed" number to your options. This keeps the hand-drawn "wobble" consistent every time you render. Without it, lines may shift slightly on re-render.

Complete JSON Example

Here's a minimal complete example with the core structure. You can load this directly into Privacy Sketch:

{
  "version": "2.0",
  "elements": [
    // Background
    { "id": "bg", "type": "rectangle", "x": 20, "y": 20, "w": 800, "h": 400,
      "options": { "fill": "#1e293b", "stroke": "#0f172a", "fillStyle": "solid" }
    },
    // Title
    { "id": "title", "type": "text", "x": 200, "y": 40, "w": 400, "h": 30,
      "text": "🔄 My Pipeline", "fontSize": 24, "fontWeight": "bold", "align": "center",
      "options": { "stroke": "#e2e8f0" }
    },
    // Stage 1: DEV
    { "id": "dev", "type": "rectangle", "x": 40, "y": 100, "w": 150, "h": 280, "borderRadius": 12,
      "options": { "stroke": "blue.500", "fill": "#172554", "fillStyle": "solid" }
    },
    { "id": "dev-label", "type": "text", "x": 40, "y": 115, "w": 150, "h": 20,
      "text": "💻 DEV", "fontSize": 14, "fontWeight": "bold", "align": "center",
      "options": { "stroke": "blue.400" }
    },
    // Stage 2: CI
    { "id": "ci", "type": "rectangle", "x": 210, "y": 100, "w": 180, "h": 280, "borderRadius": 12,
      "options": { "stroke": "green.500", "fill": "green.900", "fillStyle": "solid" }
    },
    { "id": "ci-label", "type": "text", "x": 210, "y": 115, "w": 180, "h": 20,
      "text": "✅ CI", "fontSize": 14, "fontWeight": "bold", "align": "center",
      "options": { "stroke": "green.400" }
    },
    // Arrow connecting DEV to CI
    { "id": "arrow-1", "type": "arrow", "x": 190, "y": 240, "w": 20, "h": 0, "endArrowhead": "arrow",
      "options": { "stroke": "green.400", "strokeWidth": 2 }
    }
  ]
}

🎨 Ready to Build Your Own?

Open Privacy Sketch and start creating your CI/CD pipeline diagram today. It's free, private, and runs entirely in your browser.

Open Privacy Sketch

Next Steps

Now that you've built your first pipeline diagram, here are some ways to level up: