Opscraft
DevOps from zero · Lesson 5 of 6 · 4 min read

How code becomes a running app

The path of a change

Here is the journey a code change takes in a modern team. Each box is a topic later on this site.

Enlarge diagramPush codea commit on a branchPull requestteammates review itCI: build and testruns on every changeStore the artifactversioned image in aregistryDeploy to staginga copy of productionAutomated checkssmoke andintegration testsDeploy toproductiongradually, to realusersMonitorroll back if errors rise12345678
Figure 1. The journey of one code change in a modern team. Steps 3 to 8 run automatically.
Swipe sideways to see all of it, or tap to open it full screen.

Version control with Git

Every change starts in Git, which records the history of every file. A developer creates a branch (a separate line of work), makes commits (saved snapshots with a message), and opens a pull request asking teammates to review the change before it is merged into the main branch. Git means nothing is ever truly lost and every change has an author and a reason.

Continuous integration (CI)

Continuous integration means every change is automatically built and tested as soon as it is pushed, usually in minutes. If a test fails, the developer finds out immediately, while the change is still fresh in their mind. Tools: GitHub Actions, Jenkins, GitLab CI.

Artifacts

A successful build produces an artifact — the packaged, ready-to-run output: a container image, a .jar file, a zip. Artifacts are stored in a registry (Amazon ECR, Docker Hub, Artifactory) with a version number. The key rule: build once, deploy the same artifact everywhere, so what you tested is exactly what reaches users.

Environments and continuous delivery

Teams run several copies of their system, called environments:

Enlarge diagramArtifact: app image version 1.4.2, built once by CIdevtry ideas; breaks oftenstaginglike production; final checksproductionreal userstests passapprovedsame imagesame imagesame image
Figure 2. One artifact, built once, moves through every environment. What you tested is exactly what users get.
Swipe sideways to see all of it, or tap to open it full screen.
  • dev — for developers to try things; breaks often.
  • staging — as close to production as possible; the final check.
  • production (prod) — what real users use.

Continuous delivery means every change that passes the pipeline could be released at the push of a button. Continuous deployment goes one step further: it is released automatically. Either way, the release itself is boring and repeatable.

Infrastructure as code

The servers, networks and databases themselves are also described in code, using tools such as Terraform. Instead of clicking through a cloud console, you write what you want, review it like any other code change, and let the tool create it.

Enlarge diagramYOUR CLOUD ACCOUNTWrite codemain.tf describesnetworks, servers,databasesReviewa pull request, like appcodeterraform planpreview: 3 to add, 0 todestroyterraform applymakes the real changesNetworkVPC and subnetsServersEC2 instancesDatabasemanaged RDS
Figure 3. Infrastructure as code: describe what you want, review it, preview the change, then let the tool build it.
Swipe sideways to see all of it, or tap to open it full screen.

Because the code is in Git, you can see who changed the infrastructure, rebuild an identical environment, and recover quickly after a disaster.

Monitoring and feedback

After a deployment, monitoring shows whether users are happy: request rates, error rates, response times. If errors jump, the team rolls back to the previous version first and investigates second. What they learn feeds into the next plan — closing the DevOps loop.