惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
P
Privacy International News Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Attack and Defense Labs
Attack and Defense Labs
NISL@THU
NISL@THU
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
GbyAI
GbyAI
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
N
Netflix TechBlog - Medium
S
Security Affairs
Spread Privacy
Spread Privacy
罗磊的独立博客
腾讯CDC
MyScale Blog
MyScale Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 热门话题
The Cloudflare Blog
L
LangChain Blog
博客园_首页
H
Hacker News: Front Page
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
SecWiki News
SecWiki News
A
Arctic Wolf
爱范儿
爱范儿
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
Cyberwarzone
Cyberwarzone
博客园 - 叶小钗
V
Visual Studio Blog
V
V2EX
T
Tailwind CSS Blog
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
MongoDB | Blog
MongoDB | Blog
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
CI/CD Pipelines That Actually Work: From “Why Is This Broken?” to “I Feel Like Neo”
Timevolt · 2026-06-20 · via DEV Community

The Quest Begins (The "Why")

Picture this: I’m hunched over my laptop at 2 a.m., coffee cold, staring at a red GitHub Actions badge that stubbornly reads “failed”. I’d just pushed a tiny UI tweak, and the pipeline decided it was the perfect moment to remind me that my node_modules cache was older than the dinosaurs in Jurassic Park. I’d spent the last hour wrestling with a flaky test that only failed on Windows runners, and the CI log was a wall of text that looked like the scrolls in The Lord of the Rings – epic, but completely indecipherable.

Honestly, I felt like a rookie Jedi trying to lift an X‑wing with the Force while everyone else was already flying Millennium Falcons. The pain point? Reliability. My team kept shipping hotfixes because the pipeline would randomly drop artifacts, skip steps, or hang forever on a dependency install. I needed a pipeline that didn’t feel like a boss battle every time I hit merge. So I embarked on a quest: find the holy grail of CI/CD that just works across GitHub Actions, GitLab CI, and Jenkins – the three kingdoms I most often serve.

The Revelation (The Insight)

After a weekend of digging through docs, trial‑and‑error, and a few “why did I even try this?” moments, the breakthrough came when I stopped treating each CI system as a black box and started thinking about pipeline as code – the same way we treat application code. The magic? Declarative, version‑controlled, and reusable steps that are isolated, cache‑smart, and fail fast.

Think of it like Neo seeing the Matrix: once you realize the pipeline is just another piece of software, you can refactor, test, and version it just like your src folder. The three pillars that made the difference for me:

  1. Explicit caching – store only what really changes (lockfiles, build artifacts).
  2. Matrix builds with fail‑fast – test multiple environments but bail out on the first failure to save time.
  3. Self‑contained jobs – each job pulls its own dependencies, uses containers where possible, and leaves no dirty state behind.

When I applied these ideas, the red badge turned green, and the pipeline ran in under 5 minutes instead of the dreaded 20‑minute slog. I felt like I’d just discovered the secret level in Super Mario Bros. – a warp pipe straight to the flagpole.

Wielding the Power (Code & Examples)

Below are the “before” (the struggle) and “after” (the victory) snippets for each platform. I’ll point out the traps I fell into so you can dodge them like a pro.

GitHub Actions – The Cache That Actually Caches

Before – naive caching that stored the whole node_modules folder, causing huge restores and occasional corruption.

# .github/workflows/ci.yml (before)
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Cache node_modules
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - run: npm ci
      - run: npm test

The trap: caching ~/.npm works, but if you lock the key only to package-lock.json and change a dependency version, you get a miss and end up reinstalling everything from scratch – still slow, but at least correct. The real win came when I split the cache into two layers: one for the lockfile (restore) and another for the actual node_modules (save).

After – split‑cache strategy + matrix with fail‑fast.

# .github/workflows/ci.yml (after)
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18.x, 20.x]
      fail-fast: true   # <-- stop as soon as one version fails
    steps:
      - uses: actions/checkout@v3

      - name: Cache npm packages (lockfile)
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-

      - name: Cache node_modules (actual)
        uses: actions/cache@v3
        with:
          path: ~/.npm/_cachelog
          key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-modules-

      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'

      - run: npm ci
      - run: npm test

Why it works: The first cache restores the download folder (fast), the second caches the already‑installed modules (even faster). The matrix runs two Node versions in parallel, and fail-fast means we don’t waste time if the first version blows up.

GitLab CI – Docker‑in‑Docker Done Right

Before – trying to build Docker images inside a shell executor, leading to permission errors and flaky layer caches.

# .gitlab-ci.yml (before)
stages:
  - build
  - test

build_image:
  stage: build
  script:
    - docker build -t myapp:$CI_COMMIT_SHA .
    - docker push myapp:$CI_COMMIT_SHA

run_tests:
  stage: test
  script:
    - docker run --rm myapp:$CI_COMMIT_SHA npm test

The trap: GitLab’s shared runners often run with a restrictive AppArmor profile; Docker‑in‑DinD needs privileged mode, and without it you get “operation not permitted”. Plus, each job started from scratch, pulling base images every time.

After – use the Docker executor with privileged mode and cache layers via :cache-from.

# .gitlab-ci.yml (after)
stages:
  - build
  - test

variables:
  DOCKER_DRIVER: overlay2   # faster storage driver
  IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA

build:
  stage: build
  image: docker:latest
  services:
    - docker:dind   # Docker-in-Docker service
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  before_script:
    - docker info
  script:
    - docker build --cache-from $IMAGE -t $IMAGE .
    - docker push $IMAGE

test:
  stage: test
  image: docker:latest
  services:
    - docker:dind
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  script:
    - docker pull $IMAGE
    - docker run --rm $IMAGE npm test

Why it works: By declaring docker:dind as a service, GitLab gives us a privileged Docker daemon inside the job. The --cache-from flag tells Docker to reuse previously pushed layers, turning a 2‑minute build into a 20‑second incremental one. No more “permission denied” surprises.

Jenkins – Declarative Pipeline with Shared Libraries

Before – a sprawling Scripted Pipeline copied across repos, hard‑coded paths, and no way to reuse common steps (like setting up Maven or caching Gradle).

// Jenkinsfile (before)
pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'mvn clean install -DskipTests'
            }
        }
        stage('Test') {
            steps {
                sh 'mvn test'
            }
        }
    }
}

The trap: Adding a new stage meant editing every Jenkinsfile. If the Maven version changed, you hunted down each file. Also, the agent any could land on a node missing JDK 11, causing cryptic “class not found” errors.

After – a Declarative Pipeline that pulls a shared library for common tooling and uses an agent label to guarantee the right environment.

// vars/commonTools.groovy (in shared library)
def call(Map config = [:]) {
    def toolName = config.toolName ?: 'maven'
    def version  = config.version ?: '3.9.0'
    def toolHome = tool name: toolName, version: version
    withEnv(["PATH+${toolHome}/bin=${toolHome}/bin"]) {
        return
    }
}

// Jenkinsfile (after)
@Library('my-org-pipeline-lib@main') _

pipeline {
    agent {
        label 'java11-node'   // ensures we have JDK 11 + Node if needed
    }
    options {
        timeout(time: 30, unit: 'MINUTES')
        timestamps()
    }
    stages {
        stage('Prepare') {
            steps {
                script {
                    commonTools toolName: 'maven', version: '3.9.0'
                    commonTools toolName: 'nodejs', version: '20.x'
                }
            }
        }
        stage('Build') {
            steps {
                sh 'mvn clean install -DskipTests'
            }
        }
        stage('Test') {
            steps {
                sh 'mvn test'
            }
        }
    }
}

Why it works: The shared library encapsulates the tooling logic; updating the Maven version is a one‑liner in the library, instantly propagating to all repos. The agent label guarantees we never run on a node lacking the required JDK, eliminating those dreaded “unsupported class version” errors. Plus, the Declarative syntax gives us nice stage visualization and built‑in post‑actions (like archiving test results) for free.

Why This New Power Matters

With these patterns in place, my CI/CD pipelines stopped feeling like a chore and started feeling like a force multiplier. I can now:

  • Ship faster – a typical PR builds and tests in under 5 minutes on GitHub Actions, giving reviewers quick feedback.
  • Reduce flakiness – caching and containerized environments mean the same bits run everywhere, from my laptop to the production cluster.
  • Empower the team – anyone can add a new job or tweak a matrix without digging through spaghetti scripts; the pipeline is just another readable piece of code.

In short, I went from dreading the red badge to celebrating the green one every time I push. It’s like finally mastering the lightsaber after months of fumbling with a wooden stick – the moment you feel the power humming in your hand.

Your Turn – Embark on Your Own Quest

Now it’s your turn to take up the mantle. Pick one of the three systems you use most, copy the “after” snippet, and try swapping in your own build commands. Watch the pipeline go from a flaky monster to a reliable sidekick. And when you see that green checkmark, ask yourself:

What’s the next automation dragon I can slay with a declarative pipeline?

Share your wins (or your hilarious fails) in the comments – I love hearing how fellow developers are bending CI/CD to their will. Happy hacking, and may your pipelines ever be green! 🚀