Skip to content

Commit 8f07a80

Browse files
committed
Small updates in 17
1 parent e006cc0 commit 8f07a80

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

chapter_11_ansible.asciidoc

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,14 +1330,14 @@ time, and the `migrate` seems to have worked too.
13301330
13311331
13321332
1333-
Git Tag the Release
1334-
~~~~~~~~~~~~~~~~~~~
1333+
=== Git Tag the Release
13351334
13361335
1337-
((("Git", "tagging releases")))One
1338-
final bit of admin. In order to preserve a historical marker,
1339-
we'll use Git tags to mark the state of the codebase that reflects
1340-
what's currently live on the server:
1336+
((("Git", "tagging releases")))
1337+
One final bit of admin.
1338+
In order to preserve a historical marker,
1339+
we'll use Git tags to mark the state of the codebase
1340+
that reflects what's currently live on the server:
13411341
13421342
[role="skipme"]
13431343
[subs="specialcharacters,quotes"]
@@ -1349,10 +1349,11 @@ $ *git tag $TAG*
13491349
$ *git push origin LIVE $TAG* # pushes the tags up
13501350
----
13511351
1352-
Now it's easy, at any time, to check what the difference is between
1353-
our current codebase and what's live on the servers. This will come
1354-
in useful in a few chapters, when we look at database migrations. Have
1355-
a look at the tag in the history:
1352+
Now it's easy, at any time, to check what the difference is
1353+
between our current codebase and what's live on the servers.
1354+
This will come in useful in a few chapters,
1355+
when we look at database migrations.
1356+
Have a look at the tag in the history:
13561357
13571358
[subs="specialcharacters,quotes"]
13581359
----
@@ -1365,7 +1366,10 @@ $ *git log --graph --oneline --decorate*
13651366
// RITA: Perhaps add the note about the reader emailing you when their site goes live to this point. "Tell your mum! Tell me! Email me at....""
13661367
You now have a live website! Tell all your friends!
13671368
Tell your mum, if no one else is interested!
1368-
And, in the next chapter, it's back to coding again.((("", startref="Fstage11")))
1369+
Or, tell me! I'm always delighted to see a new reader's site!
1370+
1371+
1372+
In the next chapter, it's back to coding again.((("", startref="Fstage11")))
13691373

13701374
// DAVID: maybe more of a conclusion here? It's quite a heavy chapter,
13711375
// a bit of an anticlimax to stop here. I want some inspiring note to end on.

chapter_17_second_deploy.asciidoc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,23 @@ $ pass:quotes[*ansible-playbook --user=elspeth -i www.ottg.co.uk, infra/ansible-
116116

117117
=== What to Do If You See a Database Error
118118

119-
120119
Because our migrations introduce a new integrity constraint, you may find
121120
that it fails to apply because some existing data violates that constraint.
122121

122+
[role="skipme"]
123+
----
124+
sqlite3.IntegrityError: columns list_id, text are not unique
125+
----
126+
127+
123128
At this point you have two choices:
124129

125130
1. Delete the database on the server and try again.
126131
After all, it's only a toy project!
127132

128133
2. Learn about data migrations. See <<data-migrations-appendix>>.
129134

135+
==== How to Delete the Database on the Staging Server
130136

131137
Here's how you might do option (1):
132138

@@ -140,6 +146,9 @@ so we pass in `rm db.sqlite3`.
140146
We don't need a full path because we keep the sqlite database in elspeth's home folder.
141147

142148

149+
TIP: Don't do this in prod!
150+
151+
143152

144153
=== Wrap-Up: git tag the New Release
145154

@@ -155,12 +164,13 @@ $ *git tag $TAG*
155164
$ *git push -f origin LIVE $TAG*
156165
----
157166

158-
NOTE: Some people don't like to use `push -f` and update an existing tag, and
159-
will instead use some kind of version number to tag their releases. Use
160-
whatever works for you.
167+
NOTE: Some people don't like to use `push -f` and update an existing tag,
168+
and will instead use some kind of version number to tag their releases.
169+
Use whatever works for you.
161170

162-
And on that note, we can wrap up <<part2>>, and move on to the more exciting
163-
topics that comprise <<part3>>. Can't wait!
171+
And on that note, we can wrap up <<part2>>,
172+
and move on to the more exciting topics that comprise <<part3>>.
173+
Can't wait!
164174

165175
[role="pagebreak-before less_space"]
166176
.Deployment Procedure Review

0 commit comments

Comments
 (0)