Skip to content

Commit

Permalink
chore: add heroku config
Browse files Browse the repository at this point in the history
  • Loading branch information
adalinesimonian committed Aug 23, 2024
1 parent bf54e92 commit ad0ef20
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions Aptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
worker: ./start.sh
21 changes: 21 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

START_COMMAND=heimdallr

set -e
set -u
set -x

litestream version
echo "DB_REPLICA_URL=${DB_REPLICA_URL}"

readonly DB_PATH='heimdallr.db'

if [[ -f "$DB_PATH" ]]; then
echo "Existing database is $(stat -c %s "${DB_PATH}") bytes"
else
echo "Restoring database from replica"
litestream restore -if-replica-exists -v "${DB_PATH}"
fi

litestream replicate -exec "${START_COMMAND}"

0 comments on commit ad0ef20

Please sign in to comment.