Step 12 — Two branches, two of everything¶
About 25 minutes. Branch: step-12.
The one new idea: a branch is a whole separate app.
The thing step 0 asked you to take on trust¶
You have deployed one branch for eleven steps because this page's fact was stated up front without being shown. Now you see it.
Make a second branch:
Wait for it, then:
Two different URLs. And behind them:
tutorial |
experiment |
|
|---|---|---|
| URL | its own | its own |
| Database | its own | its own — and empty |
| Redis | its own keyspace | its own |
| Environment variables | its own | its own |
| Deploy history, queue rows, logs | its own | its own |
Open the experiment branch's board. The seed items are there — because
001_items.sql ran against a fresh database and seeded it — and any idea you
submitted on tutorial is not. Nothing is shared. It is a different
application that happens to be built from a neighbouring commit.
Tell them apart¶
A badge appears on that one and not the other.
This is the step where mecca var set without -b bites
Without -b, it writes to every branch of the app. Run the command above
without it and both boards get the badge — including the one you think of as
live.
mecca var list tally -b <branch> shows you what a given branch actually
has, and is worth checking after any var set you were not fully awake for.
Which one is real?¶
Once there are two, something has to say:
That is what the dashboard reads to decide which branch is the app, and what
mecca falls back to when a command needs a branch and was not given one.
A branch called main is treated slightly differently
It is the branch that gets no segment in the URL. So the same app
deployed from main and from tutorial differ in the shape of their
hostname, not just its content — worth knowing before it surprises you.
Clean up¶
Deleting one branch does not touch the other. They were separate all along — which is the point of the whole step, demonstrated one last way.
If it didn't work¶
| Symptom | Try | Usually |
|---|---|---|
| Both branches show one URL | mecca app show -b <each> |
The second deploy has not finished |
| The badge is on both | mecca var list -b <each> |
var set without -b |
| The second branch has no data | — | Correct. Its database is its own, and new |
Reset to the reference¶
git checkout tutorial
git fetch upstream && git reset --hard upstream/step-12 && git push --force origin tutorial
Next: Step 13 — Backups