Skip to content

Commit ad0ef20

Browse files
chore: add heroku config
1 parent bf54e92 commit ad0ef20

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Aptfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
worker: ./start.sh

start.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
START_COMMAND=heimdallr
4+
5+
set -e
6+
set -u
7+
set -x
8+
9+
litestream version
10+
echo "DB_REPLICA_URL=${DB_REPLICA_URL}"
11+
12+
readonly DB_PATH='heimdallr.db'
13+
14+
if [[ -f "$DB_PATH" ]]; then
15+
echo "Existing database is $(stat -c %s "${DB_PATH}") bytes"
16+
else
17+
echo "Restoring database from replica"
18+
litestream restore -if-replica-exists -v "${DB_PATH}"
19+
fi
20+
21+
litestream replicate -exec "${START_COMMAND}"

0 commit comments

Comments
 (0)