Version control habits
Version control records every change so you can review, undo and share work safely. The tool matters less than the habits.
- Small, focused commits. One idea per commit, with a message that says why, not just what.
- Short-lived branches. Merge often to avoid painful conflicts. Branches that live for weeks drift away from the main line.
- Review before merging. A second pair of eyes catches mistakes and spreads knowledge.
- Keep secrets out. Never commit passwords or keys. Once pushed, assume they are exposed and rotate them.
- Keep main releasable. If the main branch is always in a working state, everything downstream gets easier.
CI/CD pipeline basics
Continuous integration (CI) means every change is automatically built and tested when it is pushed. Continuous delivery means the result is always ready to release; continuous deployment goes one step further and releases automatically.
A typical pipeline runs in stages, stopping at the first failure:
- Build: compile or package the code.
- Test: run fast unit tests first, slower checks later.
- Analyse: linting and basic security scans.
- Package: produce one versioned artifact.
- Deploy: ship the same artifact to staging, then production.
Containers in a nutshell
A container bundles an application with the libraries it needs and runs it in an isolated process on a shared operating system kernel. It is lighter than a full virtual machine and starts quickly.
- An image is the read-only template; a container is a running instance of it.
- A build file describes how to make the image, so it is repeatable and reviewable.
- Keep images small, run as a non-root user, and pin versions rather than using “latest”.
- Containers should be disposable. Store data in external volumes or services, not inside the container.
When you run many containers, an orchestrator handles scheduling, restarts and scaling. Learn the basics of a single container first.
Infrastructure as code
Instead of clicking through consoles, you describe servers, networks and permissions in text files that live in version control. Tools in this category are usually declarative: you state the desired result and the tool works out the steps.
- Repeatable: create the same environment again whenever needed.
- Reviewable: infrastructure changes go through the same pull requests as code.
- Auditable: history shows who changed what and when.
- Preview first: look at the planned changes before applying them.
Avoid manual edits to live systems; they cause drift between what the code says and what exists.
Monitoring and logging basics
You cannot fix what you cannot see. Three signals cover most needs:
- Logs: timestamped records of events. Use a consistent, structured format and never log secrets.
- Metrics: numbers over time such as error rate, latency and memory use.
- Traces: the path of a single request across services.
Start by watching the basics: is the service up, how fast does it respond, and how many requests fail? Alert on symptoms users feel, and keep alerts few and actionable so people do not learn to ignore them.
Your first pipeline: a checklist
- Code lives in version control with a protected main branch.
- The project builds from a clean checkout with one command.
- Automated tests run on every push and block failing merges.
- A linter or formatter runs in the pipeline.
- The pipeline produces one versioned artifact or image.
- Secrets come from the pipeline’s secret store, never from the repository.
- A staging deploy happens automatically after tests pass.
- Production deploys are one click and can be rolled back.
- Basic logs and a health check are in place after release.
FAQ
Do I need to learn every tool?
No. Learn the concepts first, then pick one tool per category. The ideas carry over between tools.
Is DevOps a job title or a practice?
Mostly a practice: developers and operations sharing responsibility for building and running software. Some organisations also use it as a role name.
Should small projects bother with CI/CD?
Yes, a simple pipeline that builds and tests on each push pays off even for one-person projects.
What should I automate first?
Whatever you repeat and fear getting wrong, usually the build and test steps, then deployment.
Contact
Suggestions or corrections are welcome: [email protected].