2
0

💚 Build docker images for postgresql only

Still need to find a way to change the database provider at runtime. For now let's just only enable postgresql for docker deployments

Closes #324
This commit is contained in:
Baptiste Arnaud
2023-02-19 10:09:45 +01:00
parent 621cd58244
commit 8a0155dab8
4 changed files with 9 additions and 13 deletions

View File

@ -10,6 +10,8 @@ on:
jobs:
build:
env:
DATABASE_URL: 'postgresql://'
strategy:
matrix:
app: ['builder', 'viewer']

View File

@ -7,3 +7,7 @@ To do so, follow these instructions:
1. Copy `packages/db/.env.example` to `packages/db/.env` and replace `DATABASE_URL` with a development branch
2. From the `packages/db` directory, run a the db push command: `pnpm run db:push`
3. Then, in Planetscale dashboard, or using their CLI, you can create a new deploy request from this development branch to your production branch.
:::note
You can't connect to Planetscale database if you are deploying with Docker as docker images are currently built only with postgresql support.
:::

View File

@ -2,18 +2,12 @@
ENVSH_ENV=./apps/builder/.env.production ENVSH_OUTPUT=./apps/builder/public/__env.js bash env.sh
if [[ $DATABASE_URL == postgresql://* ]]; then
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
else
./node_modules/.bin/prisma generate --schema=packages/db/mysql/schema.prisma;
fi
echo 'Waiting 5s for db to be ready...';
sleep 5;
if [[ $DATABASE_URL == postgresql://* ]]; then
./node_modules/.bin/prisma migrate deploy --schema=packages/db/postgresql/schema.prisma;
fi
node apps/builder/server.js;

View File

@ -2,10 +2,6 @@
ENVSH_ENV=./apps/viewer/.env.production ENVSH_OUTPUT=./apps/viewer/public/__env.js bash env.sh
if [[ $DATABASE_URL == postgresql://* ]]; then
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
else
./node_modules/.bin/prisma generate --schema=packages/db/mysql/schema.prisma;
fi
node apps/viewer/server.js;