Skip to content

Commit

Permalink
deploy migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
broneks committed Nov 27, 2024
1 parent 161676a commit 636a793
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ RUN if [ "$ENV" = "local" ]; then \

EXPOSE 8001

ENTRYPOINT ["db/migrations.sh"]

CMD if [ "$ENV" = "local" ]; then \
air; \
else \
Expand Down
11 changes: 11 additions & 0 deletions db/migrations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -Cu

echo "~~ Running migrations..."

/go/bin/migrate -database $DATABASE_URL -path db/migrations up

echo "~~ Migrations have been applied."

exec "$@"
3 changes: 0 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ primary_region = 'yyz'
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[deploy]
release_command = '/go/bin/migrate -database $DATABASE_URL -path db/migrations up'

0 comments on commit 636a793

Please sign in to comment.