Ship a change, and break one on purpose
Change the footer, watch it go live without touching AWS, then see a broken build get stopped.
About 25 min · Verified 8 October 2026
On this page
Part 1: a change that ships#
The page footer says "ShortLink — a DevOps with AWS workshop project." You will add a line to it. It is a harmless, visible change that no test checks.
Create a branch#
git switch main
git pull origin main
git switch -c footer-noteEdit the footer#
Open shortlink-web/src/App.jsx and find the footer text (around line 114):
- ShortLink — a DevOps with AWS workshop project.
+ ShortLink — a DevOps with AWS workshop project. Deployed by my own CI/CD pipeline.Test and build locally first#
npm --prefix shortlink-web testTests 23 passed (23)Commit, push the branch, then merge#
git add shortlink-web/src/App.jsx
git commit -m "feat(web): add a note about the pipeline to the footer"
git push -u origin footer-noteThe pipeline does not start: it only listens to main. Merge when you are happy:
git switch main
git merge --no-ff footer-note -m "Merge footer-note"
git push origin mainWatch it go live#
shortlink-web-prod starts by itself within about a minute. When DeployWeb is green, hard-refresh <WEB_URL>.
aws s3 sync.Part 2: break the build on purpose#
Introduce a syntax error#
git switch -c break-the-buildAdd a line of invalid code at the end of shortlink-web/src/main.jsx:
+const = ;Run npm --prefix shortlink-web run build and see Vite refuse to build. Now push it to main anyway for the experiment:
git add shortlink-web/src/main.jsx
git commit -m "chore: break the build on purpose"
git switch main
git merge break-the-build
git push origin mainSee what the pipeline does#
The Build stage turns red and its log shows the Vite error. DeployWeb never starts. Reload your site: it is exactly as before, because the broken build never reached S3. aws s3 sync --delete would otherwise have replaced a working site with a broken one.
Revert#
git revert --no-edit HEAD
git push origin mainA new execution tests, builds and republishes the good version.
Part 3: the API address is baked in#
This is the lesson that saves hours. Suppose you rebuild your load balancer and its address changes.
Change the variable and rebuild#
- Open CodeBuildBuild projectsshortlink-web-buildEditEnvironmentAdditional configuration.
- Change
VITE_API_BASE_URLto the new address and Update environment. - Nothing happens by itself, because the pipeline starts on commits, not on settings. Open CodePipelineshortlink-web-prodRelease change.
Until that rebuild finishes, the live site still calls the old address, because the old value is stored inside the JavaScript files. Open the browser developer tools → Network to confirm which host the calls go to.
Next: rollbacks and operations.
Found a mistake? Edit this page on GitHub.