← Back
SIGNAL SERIES · START HERE

START

HERE

Foundations, Git and CI — the ground everything stands on.
Foundations
Source Control
Integration
V4 · 2026 · START HERE · verified 2026-09-18
START HERE

🗺️ The Map — The Whole Route

MAP

Three chapters, one line: Foundations draws the pipeline every merge travels; Source Control builds the gate that guards it; Integration turns the gate into daily discipline.

FOUNDATIONS lifecycle──►SOURCE CONTROL gate──►INTEGRATION discipline
commit → verify → merge → repeat
KEY IDEASmall merges, verified automatically, fixed immediately — that discipline feeds every pipeline downstream.
START HERE

What CI/CD Actually Is

03B

CI/CD is automation plus discipline: every commit verified by machines, every release decided by policy. One line: commit → CI → artifact → CD → observe.

COMMIT push──►CI verify──►ARTIFACT freeze──►CD decide──►OBSERVE learn
green travels forward, red stops the line, feedback flows back
PracticeQuestion it answers
Continuous IntegrationDoes this change work — build, test, scan green?
Continuous DeliveryIs it releasable — staged auto, prod by approval?
Continuous DeploymentDid it ship — prod automatic, rollback armed?
GitOpsIs reality matching git — pull, drift-corrected?
KEY IDEACI answers does-it-work; Delivery keeps it releasable; Deployment ships it.
🎓 EXAMName which gate each change passed: CI gate on merge, approval gate on release, sync gate on deploy.

⏭️ Next: Foundations

📘 Start Here · By Nabawy— 4b —▤ TOC ◀ Prev Next
START HERE

Foundations

04

A pipeline is not magic.

It is a deterministic sequence of machines making decisions about your code — from the moment you push to the moment users feel the change.

1 / The CI/CD Lifecycle

CodeCODEcommit
→
BuildBUILDcompile
→
TestTESTverify
→
ArtifactARTIFACTfreeze
→
ReleaseRELEASEapprove
→
DeployDEPLOYrun
Every chapter of this manual lives somewhere on this line. Feedback flows backward: deploy → observe → next commit.

2 / How to read this manual

Each concept answers WHAT · WHY · WHEN · HOW · WHAT CAN FAIL. Green means passed, red means failed, amber means a human must decide, purple means artifact. Color always pairs with a symbol and a label — the book survives grayscale printing.

KEY IDEADevOps is the culture of shared ownership; CI/CD is its automation — small merges verified on every push, releasable always, deployed by decision.
📘 Start Here · By Nabawy— 4 —▤ TOC ◀ Prev Next
START HERE

Continuous Integration

05

3 / What Is Continuous Integration

Git

Developers merge small changes into shared main frequently; every merge triggers an automated build + test + scan. CI answers one question: does this change work?

WHEN — on every push and every pull request. HOW — a pipeline job checks out the exact commit, builds it in a clean environment, and reports green or red back to the branch in minutes.

WHY THIS EXISTS

Without automated integration, a broken change travels for days before anyone discovers it. CI moves that discovery to within minutes of the commit — when the author still remembers what they did.

4 / What happens without CI/CD

  • Long-lived branches → merge hell. Weeks of divergent work collide; untangling takes days.
  • "Works on my machine" releases. Testing one thing, shipping another — every deploy a gamble.
  • Manual testing → bugs reach users. Humans skip steps under pressure.
  • Manual deploys → release fear. Rare, big, traumatic events nobody runs on Friday.
  • No feedback loop. The same bug class ships again and again.

Integration pain is paid minutes per commit with CI/CD, or weeks per release without it.

📘 Start Here · By Nabawy— 5 —▤ TOC ◀ Prev Next
START HERE

CI vs CD · Delivery vs Deployment

06

5 / CI vs Delivery vs Deployment

CIContinuous DeliveryContinuous Deployment
QuestionDoes it work?Could we ship it?— (ships itself)
TriggerCommit / mergeValidated artifactValidated artifact
Human gateNoYes — approvalNo
OutputVerified codeReleasable artifactProduction deployment
DO YOU DEPLOY TO PRODUCTION AUTOMATICALLY?
YES → CONTINUOUS DEPLOYMENTEvery passing change ships. Requires progressive delivery + instant rollback.
NO → CONTINUOUS DELIVERYEvery passing change is releasable. A human or policy decides when.
GOTCHA

A green build does not mean the application works in production. It means only the checks inside that pipeline passed.

📘 Start Here · By Nabawy— 6 —▤ TOC ◀ Prev Next
START HERE

Pipeline & Status

07

6 / Anatomy of a Pipeline

01 Source● PASSEDSOURCEGit push to main
→
02 Build● PASSEDBUILDnpm ci + build
→
03 Test● RUNNINGTESTunit + integration
→
04 Artifact● WAITINGARTIFACTimage:sha-9f3a

Stages are phases, jobs are units of work inside them, steps are single operations, runners are the machines. Progression reads left to right; a red stage blocks everything downstream.

TermMeaning
PipelineThe automated workflow
StageLogical phase (build, test, deploy)
JobUnit of executable work inside a stage
StepSingle operation inside a job
Runner / AgentExecution environment running the work

7 / The Status System

● RUNNING ● PASSED ● FAILED ● BLOCKED ● WAITING ● SKIPPED
📘 Start Here · By Nabawy— 7 —▤ TOC ◀ Prev Next
START HERE

Environments & Flow

08

8 / Environment Lanes: One Artifact, Three Tracks

DEVELOPMENT BUILD → TEST
push → build ✓ → unit tests ✓ → image staged
STAGING DEPLOY → VERIFY
deploy sha-9f3a → smoke ✓ → scan ✓ → awaiting approval
PRODUCTION APPROVE → DEPLOY
◌ approval gate → deploy same digest → observe

9 / The Deployment Loop

GitCOMMITdeveloper pushes
↓
PipelinePIPELINEbuild → test → scan
↓
ArtifactARTIFACTapp:sha-9f3a → registry
↓
APPROVALautomation stops — a human decides
↓
DeployDEPLOYsame digest to production
↓
ObserveOBSERVE → FEEDBACKmetrics → developer → next commit
📘 Start Here · By Nabawy— 8 —▤ TOC ◀ Prev Next
START HERE

Console

09

10 / From Push to Pipeline

$ git push origin main



→ pipeline triggered · commit 9f3a2c1



[01] BUILD     PASSED   1m 12s

[02] TEST      RUNNING · 214/300

[03] SCAN      WAITING

[04] ARTIFACT   WAITING

11 / Command and Result

COMMAND

$ docker build -t registry/app:sha-9f3a .
$ docker push registry/app:sha-9f3a

RESULT

Successfully built 7f91c2
Successfully tagged sha-9f3a
Pushed digest sha256:4d…e9
WHY IT MATTERS the pushed digest is the frozen, promotable unit. Staging and production deploy this exact hash; nothing is ever rebuilt between environments.
📘 Start Here · By Nabawy— 9 —▤ TOC ◀ Prev Next
START HERE

Artifact & Gate

10

12 / The Artifact Identity

Source codeSOURCE CODErepo @ 9f3a2c1
↓
BuildBUILDnpm ci → bundle
↓
ArtifactARTIFACT · app:sha-9f3aDocker image · JAR · binary · Helm chart
↓
RegistryREGISTRYstored, versioned, distributable
↓
DeployDEPLOYsame digest everywhere

13 / The Approval Gate

AUTOMATED build ✓ · test ✓ · scan ✓ · artifact ✓  →  ◌ APPROVAL — a human decision is required  →  PRODUCTION
CONTEXT — PRODUCER & CONSUMER

The build pipeline produces the artifact; the deployment pipeline consumes it; the registry stores it. Lifecycle: build → store → promote → deploy. Anything that breaks this chain — a rebuild, a mutable tag, a skipped gate — voids every check upstream.

📘 Start Here · By Nabawy— 10 —▤ TOC ◀ Prev Next
START HERE

Failure & Recovery

11

14 / Failure as a State Transition

Build passedBUILD ✓compiles
↓
Tests passedTEST ✓300/300 pass
↓
SecuritySECURITY ✕critical CVE in base image
↓
Deployment blockedDEPLOYMENT BLOCKEDpromotion refused — artifact quarantined
RECOVERY LOOP

FAILURE → LOGS → ROOT CAUSE → FIX → NEW COMMIT → PIPELINE. Every incident must land a new check, or it will recur.

GOTCHA

Never bypass a red gate with an admin override "just this once". The override becomes the process.

📘 Start Here · By Nabawy— 11 —▤ TOC ◀ Prev Next
START HERE

Check & Map

12

15 / Interview Check

Q1 Delivery vs Deployment?

Delivery keeps software production-ready behind an approval; Deployment releases validated changes automatically.
Q2 Why must staging and production share one artifact digest?

Otherwise you tested one binary and shipped another — verification is void.

16 / The CI/CD System Map

SourceSOURCEcommit
→
CICIbuild / test
→
ArtifactARTIFACTdigest
→
CDCDrelease
STAGING → ◌ APPROVAL GATE → PRODUCTION
OBSERVE → FEEDBACK → next commit
🎓 EXAMCI/CD in one breath: every merge to main triggers a pipeline that builds, tests and scans in minutes; stages run jobs on runners and produce exactly one immutable artifact digest; Continuous Delivery keeps every change releasable behind an approval, Continuous Deployment ships it; staging and production deploy the same digest; a red gate is never bypassed.

⏭️ ⏭️ Next: Source Control

📘 Start Here · By Nabawy— 12 —▤ TOC ◀ Prev Next
START HERE

Source Control

13

Picking up from Foundations, where a Git push triggered the lifecycle — we now examine the machinery of that trigger: branches isolate work, pull requests gate it, triggers fire pipelines.

01 / What Each Piece Is

Git

Git — distributed version control; every commit is a snapshot with author, message, parent.

Branch

Branching — an independent line of work (feature/login) forked from main.

PR

Pull Request — a merge proposal combining human review with automated status checks.

Trigger

CI Trigger — the event that starts a pipeline: PR opened/updated, push to main, schedule, manual.

02 / Why the Gate Exists

Direct pushes to main bypass review and verification. The branch → PR → CI → merge flow makes every change Reviewed, Tested, and Traceable before it can break the pipeline.

📘 Start Here · By Nabawy— 13 —▤ TOC ◀ Prev Next
START HERE

Flow & Commands

14

03 / How the Flow Executes

BranchBRANCHsmall logical commits
↓
PRPULL REQUESTtrigger fires
↓
ChecksCHECKSbuild · test · scan post back
↓
MergeMERGEgreen + approved only

04 / Commands

$ git checkout -b feature/login

$ git add -A && git commit -m "feat(auth): add login validation"

$ git push -u origin feature/login



# then open the PR — CI trigger fires automatically
# .github/workflows trigger: CI on every PR + push to main

on:

  pull_request:

  push:

    branches: [main]
📘 Start Here · By Nabawy— 14 —▤ TOC ◀ Prev Next
START HERE

Models & Discipline

15

05 / Branching Models

ModelRuleBest for
GitHub FlowBranch → PR → main → deployCD teams (this series' default)
Git Flowdevelop + release/* + hotfix/*Versioned releases
Trunk-BasedTiny branches, merge dailyHigh-velocity CI

06 / Failure Modes & Best Practices

  • Long-lived branches → merge hell; fix with trunk-based discipline.
  • Red checks ignored; fix with required status checks.
  • Merge-queue races; fix with merge queues, linear history.
RULES one logical change per PR (< ~400 lines) · green CI + 1 approval before merge · conventional commits (feat:, fix:) so changelogs automate.
GOTCHA

"Merging equals deploying" is false. Merging makes a change a candidate; Continuous Delivery decides deployment.

📘 Start Here · By Nabawy— 15 —▤ TOC ◀ Prev Next
START HERE

Check & Handoff

16

07 / Interview Check

Q3 Explain the PR as a quality gate.

Human review (design) + automated checks (correctness) + merge policy (green + approved = mergeable).
Q4 Map the trigger types.

Push, pull request, schedule, manual dispatch, tag/release.

08 / Handoff

The trigger fires — now something must execute. This workflow continues in Pipelines, Build, Test & Artifacts, where the triggered pipeline runs build, test, and scan.

🎓 EXAMBranch small → open a PR → CI verifies → merge on green + approval. Trunk-based is the default: tiny branches, daily merges, flags instead of long branches. Merge queues serialize busy mains; linear history keeps main bisectable. Merging makes a change a candidate — Delivery decides deployment.

⏭️ ⏭️ Next: Integration

📘 Start Here · By Nabawy— 16 —▤ TOC ◀ Prev Next
START HERE

Integration

17

Picking up from Source Control, where the PR gate was built — CI is the discipline that makes the gate meaningful: integrate daily, verify automatically, fix immediately.

01 / The Three Habits

IntegrateINTEGRATEbranches live hours, never weeks
↓
VerifyVERIFYevery merge runs the full gate
↓
FixFIXred main = top priority, stop the line

Integration pain grows with branch age: two-day branches merge in minutes, two-month branches in weeks.

📘 Start Here · By Nabawy— 17 —▤ TOC ◀ Prev Next
START HERE

Gates

18

02 / PR Gates & Merge Queues

  • PR gate — required checks + approvals in branch protection. No green, no merge. No admin overrides.
  • Merge queue — serializes merges on busy main: rebase onto latest green, re-verify, land. Kills the green-on-branch-red-on-main race.
  • Linear history — rebase/squash keeps main bisectable: any commit builds and reverts cleanly.

03 / Trunk Discipline

RULES tiny branches, daily merges · flags hide unfinished work, not long branches · main always releasable · whoever breaks it fixes it first · measure merges per dev per week.
  • Long branches → merge hell (WIP limits + flags).
  • Red main normalized → quality collapse (stop-the-line culture).
  • Flaky gates → bypassed checks (quarantine flakes, never disable gates).
Q5 CI practice vs CI pipeline?

Discipline (merge small, verify, fix first) vs machinery (the pipeline that enforces it).
DISCIPLINE DETAILS preflight builds validate diffs before landing on main · rotating build master reverts lingering breakage on large teams · ratcheting gates fail only when warnings or duplication increase.
📘 Start Here · By Nabawy— 18 —▤ TOC ◀ Prev Next
START HERE

Handoff

19

04 / Handoff

Small merges, verified automatically, fixed immediately — that discipline feeds every pipeline downstream. Continue in Pipelines, Build, Test & Artifacts.

🎓 EXAMCI is discipline plus machinery: integrate daily, verify every merge automatically, fix a red main first. PR gates, merge queues and required checks enforce it; trunk discipline, flags and a releasable main sustain it. Practice versus pipeline: habits versus the automation that enforces them.
📘 Start Here · By Nabawy— 19 —▤ TOC ◀ Prev Next
START HERE

📇 Quick Revision — Terms Table

REF
PipelineThe automated workflow from commit to production.
StageA logical phase: build, test, scan, deploy.
JobA unit of executable work inside a stage.
StepA single operation inside a job.
RunnerThe machine executing jobs; agent in Jenkins.
ArtifactVersioned build output: image, JAR, binary.
DigestContent hash pinning the exact artifact (sha-9f3a).
RegistryStorage and distribution for artifacts.
PromotionApproving the same artifact for the next environment.
Gate / CheckA required verification before proceeding.
Merge queueSerializes merges onto latest green main.
Trunk-basedTiny branches merged daily; flags hide unfinished work.
BranchAn independent line of work forked from main.
Pull requestMerge proposal coupling human review with CI checks.
TriggerThe event starting a pipeline: push, PR, schedule, manual.
StagingProd-like rehearsal; deploys automatic.
ProductionReal users; deploys gated or automated.
ApprovalThe human or policy decision releasing to production.
Continuous DeliveryEvery change releasable; deployment is a decision.
Continuous DeploymentEvery passing change ships by itself.
KEY IDEACover the right column and define each term aloud. Any stumble goes back to its chapter.
START HERE

🎤 Concept Questions — Distilled Answers

REF
Q1 Delivery vs Deployment?

Delivery keeps software production-ready behind an approval; Deployment releases validated changes automatically.
Q2 Why must staging and production share one artifact digest?

Otherwise you tested one binary and shipped another — verification is void.
Q3 Explain the PR as a quality gate.

Human review for design plus automated checks for correctness plus merge policy: green and approved equals mergeable.
Q4 Name the trigger types.

Push, pull request, schedule, manual dispatch, tag or release.
Q5 CI practice vs CI pipeline?

Discipline — merge small, verify, fix first — versus machinery: the pipeline that enforces it.
Q6 What causes merge hell, and what fixes it?

Long-lived divergent branches; trunk-based discipline with tiny daily merges and flags.
Q7 A green build passed. Does the app work in production?

Not necessarily — it means only the checks inside that pipeline passed.
Q8 Trunk-based vs Git Flow?

Trunk: branch to PR to main to deploy, for CD teams. Git Flow: develop plus release branches, for versioned releases.
Q9 ⭐ Tell me about a checkout that broke main. What did you change?

STAR story: red main on a Friday deploy — stopped the line, reverted first, then landed a required check so the class of breakage can never merge again.
START HERE

📌 Command Cheat Sheet

REF
Git
git checkout -b feat/xshort branch, merge daily
git push -u origin feat/xpublish + trigger CI
gh pr create --fillPR with CI gate
Docker
docker build -t registry/app:SHA .versioned image
docker push registry/app:SHAsame digest everywhere
NOTEDiagnostic order: red gate first — read the failing check, reproduce locally, fix, re-verify. Never bypass.
START HERE

🧪 Self-Quiz + Answer Key

REF
Q1 What single question does CI answer?
Q2 Name the six pipeline stages in order.
Q3 What makes an artifact promotable?
Q4 Green plus approved equals…
Q5 What does a merge queue kill?
Q6 Flags hide unfinished work instead of…
Q7 Who fixes a red main, and when?
Q8 Delivery vs Deployment in one line each?
Answer key
  1. Does this change work?
  2. Source, build, test, artifact, release, deploy.
  3. An immutable digest stored versioned in a registry.
  4. Mergeable.
  5. The green-on-branch-red-on-main race.
  6. Long branches.
  7. Whoever broke it — first, before anything else.
  8. Delivery: releasable behind a decision. Deployment: shipped automatically.
FINAL CHECKEight for eight from memory, twice in a row — the foundations are yours. Open Pipelines, Build, Test & Artifacts next.

Related books