Beginner Level
This section covers fundamental concepts of CI/CD, including basic principles, tools, and common practices.
What is CI/CD?
CI/CD stands for Continuous Integration and Continuous Delivery/Deployment:
- Continuous Integration (CI) — every developer's changes are automatically built and tested when merged into a shared branch, so integration problems surface in minutes instead of weeks
- Continuous Delivery (CD) — the pipeline automatically prepares a production-ready release; a human presses the final "deploy" button
- Continuous Deployment — the last step is automated too: every change that passes the pipeline reaches production with no human gate
The three share one goal: make releasing software a routine, low-risk event instead of a stressful milestone.
What are the key components of a CI/CD pipeline?
- Source control (Git) — the trigger and the source of truth for every change
- Build tools — compile the code and produce an artifact (Maven, npm, Docker)
- Test automation — unit, integration, and end-to-end checks that gate quality
- Artifact/repository store — keeps versioned build outputs (Artifactory, GitHub Packages, a container registry)
- Deployment tooling — promotes the artifact to environments (Argo CD, Jenkins, cloud deployers)
- Monitoring/feedback — verifies the release is healthy after it ships
The pipeline is the wiring between these: one automated chain from "developer pushed code" to "production is updated and verified".
What is Jenkins and what is it used for?
Jenkins is an open-source automation server — the veteran of CI/CD. It runs pipelines that build, test, and deploy applications on whatever schedule or trigger you define.
Its strengths: a massive plugin ecosystem (1,800+ integrations with Git, Docker, Kubernetes, cloud providers), pipelines-as-code via a
Jenkinsfile, and full self-hosting control. Its trade-offs: you operate the servers yourself, and plugin management needs care. Newer alternatives like GitHub Actions and GitLab CI trade that flexibility for zero-maintenance hosted runners.What is the difference between Continuous Delivery and Continuous Deployment?
- Continuous Delivery — the pipeline builds, tests, and stages a release automatically, but a human approves the final production push
- Continuous Deployment — every change that passes the pipeline goes to production automatically, with no human approval step
Choose delivery when releases need a business decision (marketing timing, compliance sign-off); choose deployment when your test and monitoring safety nets are strong enough to trust fully. Everything before that final step is identical in both.
What is a build pipeline?
A build pipeline is the automated sequence that turns source code into a deployable, verified artifact:
codeEach stage is a quality gate — if tests fail, the pipeline stops and the broken code never gets closer to production. The output (a versioned artifact like a container image or a JAR) is what later stages deploy, which is why "build once, deploy the same artifact everywhere" is a core pipeline principle.
What is version control and why is it important in CI/CD?
Version control (Git) tracks every change to the codebase with history, branches, and blame. In CI/CD it plays three roles:
- Trigger — pushes and pull requests are what start pipelines
- Quality gate — pull requests require a green pipeline before merging
- Rollback — if a release breaks, you revert to a known-good commit (or the artifact built from it)
Without version control there is no CI/CD — automation needs a single, trusted source of what the code is.
What are the basic stages of a CI/CD pipeline, in order?
- Source — checkout the exact commit that triggered the build
- Build — compile/assemble the code; catch syntax and dependency errors
- Test — unit first (fast), then integration; fail fast here
- Package — produce the versioned artifact (image, JAR, bundle)
- Deploy — promote that artifact to environments: dev → staging → production
- Verify — smoke tests and monitoring confirm each environment is healthy
The order matters: cheapest, fastest checks run first so failures are caught before expensive stages.
What is a Dockerfile and why is it important in CI/CD?
A Dockerfile is the recipe for building a container image — the standard CI/CD artifact:
dockerfileIt matters because the image makes builds portable and immutable: the pipeline builds the image once, and the exact same artifact is tested and shipped everywhere — no "works on my machine". The Dockerfile is versioned with the code, so the build itself is reproducible.
What is automated testing in CI/CD?
Automated testing means the pipeline — not a human — verifies every change:
- Unit tests — fast, isolated logic checks; run on every commit
- Integration tests — verify services, databases, and APIs work together
- End-to-end tests — simulate real user flows; slower, so run fewer of them
- Performance/smoke tests — catch regressions in speed and basic health before release
The design principle is the test pyramid: many cheap unit tests, fewer expensive end-to-end tests. A pipeline that runs for an hour on flaky browser tests trains developers to ignore it — which defeats the purpose.
What is a build artifact?
A build artifact is the versioned output of the build stage — the thing you actually deploy:
- Container image (
myapp:1.4.2) — the standard for modern deployments - Compiled binaries/JARs/Wheels
- Static bundles (frontend builds)
Best practice: tag artifacts with the version/commit they were built from and store them in an artifact repository — never rebuild "the same version" later, because environments, dependency resolution, and caches make rebuilds subtly different.
- Container image (
What is a webhook in CI/CD?
A webhook is an HTTP callback: when an event happens in one system, it automatically notifies another — pushing the event instead of the other system polling for it.
In CI/CD, webhooks are how pipelines start: GitHub tells Jenkins "a commit landed on main" and the build kicks off within seconds. The same pattern connects tools together — build finished → webhook → deploy system starts; deployment done → webhook → chat notification. Without webhooks, you'd rely on scheduled polling, which is slower and noisier.
What is environment configuration in CI/CD?
Environment configuration is everything that differs between dev, staging, and production while the code stays the same:
- Database and service endpoints
- Feature settings and integration keys
- Resource sizes and replica counts
The best practice it enables: the same artifact is promoted through environments, with only the configuration changing per environment. Configuration should live in version-controlled config files or config services — and secrets should come from a secrets manager, never from files checked into Git.
What is a build trigger?
A build trigger is the event that starts a pipeline:
- Push/merge to a branch — the workhorse: every commit gets built and tested
- Pull request opened/updated — validate code before it merges
- Scheduled (cron) — nightly builds, dependency update checks
- Manual — controlled production deploys or on-demand jobs
- Upstream completion — stage 2 starts when stage 1's pipeline succeeds
Choosing triggers well is part of pipeline design: fast checks on every PR, heavier suites on merge or nightly — keeping feedback quick without skipping coverage.
What are environment variables in CI/CD?
Environment variables pass configuration into the pipeline and the application without changing code — build numbers, target environments, feature settings, and credentials.
Rules worth knowing:
- Non-secret config (e.g.,
NODE_ENV=production) can live in pipeline definitions - Secrets (API keys, database passwords) must come from the CI system's encrypted secret store or a vault — never hardcoded in pipeline files, which are usually checked into Git
- Secrets should be masked in logs, and ideally injected only into the steps that need them (least privilege)
- Non-secret config (e.g.,
What is a deployment strategy?
A deployment strategy defines how new versions replace old ones while the application serves users:
- Recreate — stop old, start new (simple, but has downtime)
- Rolling update — replace instances in batches; capacity stays up throughout
- Blue-green — two identical environments; switch traffic atomically
- Canary — send a small slice of traffic to the new version, watch metrics, expand
- Feature flags — deploy the code dark, release the feature separately
Pick based on risk and infrastructure: rolling for everyday updates, canary when a bad release must be caught by metrics before users do.
What is a build agent/runner?
A build agent (GitHub calls them runners; Jenkins calls them agents/nodes) is the machine that actually executes your pipeline jobs — checking out code, compiling, running tests.
Two models: hosted/ephemeral (GitHub-hosted runners, cloud agents) — fresh, disposable machines the provider maintains; and self-hosted — machines you own, needed for special hardware (GPUs), private network access, or compliance. Best practice: keep agents ephemeral and clean — a long-lived agent that accumulates state from old builds is a classic source of "works on the agent, fails in prod" mysteries.
What is pipeline as code?
Pipeline as code means the pipeline definition lives in a file inside the application's repository, versioned and reviewed like application code:
yamlWhy it matters: pipeline changes go through the same PR review as code changes, history is tracked, branching works, and every repo is self-describing. It replaced the old "configure the build in a web UI" world, where pipelines were unreviewable and impossible to reproduce.
What is a build status, and what should the team do with it?
Build status is the pipeline's verdict on a commit: success (green), failure (red), in progress, or cancelled.
The cultural part is the interview answer:
- A red main branch is the team's top priority — everyone stops to fix it before writing new code
- PRs are only merged green (branch protection enforces this)
- Flaky/failing tests get fixed or quarantined immediately — an ignored red pipeline trains the team to ignore all signals
Teams surface status via badges, Slack notifications, and merge requirements so the signal is impossible to miss.
What is an artifact repository?
An artifact repository stores versioned build outputs and dependencies in one managed place:
- Container registries — Docker Hub, ECR, GCR, GHCR
- Package repositories — Artifactory, Nexus, GitHub Packages (JARs, npm, PyPI packages)
Why pipelines need them: builds pull dependencies from the repository (fast, cached, immune to upstream outages) and push artifacts to it (versioned, immutable, ready to deploy). Deploying then means "run exactly artifact X" — never "rebuild and hope".
What is a deployment environment?
A deployment environment is an isolated, independently configured copy of your application stack:
- Development — the developer's own sandbox; fast feedback, no guarantees
- Staging/QA — production-like configuration for integration and pre-release testing
- Production — real users, real money, real monitoring
The discipline to describe: artifacts are promoted in one direction (dev → staging → prod), the same artifact binary moves through each (only configuration differs), and each hop has its own verification gates. Skipping environments — or rebuilding artifacts per environment — is where release bugs are born.
What is a rollback, and why must every pipeline have one?
A rollback is returning to the previous known-good version when a release misbehaves — and "how do we get back?" is a question you must answer before deploying:
- Application — redeploy the previous artifact/image (Kubernetes:
kubectl rollout undo) - Database — trickier: schema changes must be designed to be backward-compatible, since data can't just "roll back"
- Feature level — feature flags can disable a bad feature without any redeploy at all
Fast rollback changes team psychology: releases stop being scary because every deploy is reversible. It's the safety net that makes deploying frequently rational.
- Application — redeploy the previous artifact/image (Kubernetes: