mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
git actions v2
This commit is contained in:
parent
7dd4d8ae86
commit
a2dbfed19c
4
Docker/scripts/deploy_database.sh
Normal file → Executable file
4
Docker/scripts/deploy_database.sh
Normal file → Executable file
@ -8,8 +8,8 @@ fi
|
|||||||
|
|
||||||
if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]; then
|
if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]; then
|
||||||
export DATABASE_URL
|
export DATABASE_URL
|
||||||
echo "Database URL: $DATABASE_URL"
|
./node_modules/.bin/prisma migrate deploy --schema=prisma/$DATABASE_PROVIDER-schema.prisma
|
||||||
./node_modules/.bin/prisma generate --schema=prisma/$DATABASE_PROVIDER-schema.prisma
|
./node_modules/.bin/prisma generate --schema=prisma/$DATABASE_PROVIDER-schema.prisma
|
||||||
else
|
else
|
||||||
echo "Error: Database provider $DATABASE_PROVIDER invalid."
|
echo "Error: Database provider $DATABASE_PROVIDER invalid."
|
||||||
exit 1
|
exit 1
|
||||||
|
16
Docker/scripts/generate_database.sh
Normal file
16
Docker/scripts/generate_database.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./Docker/scripts/env_functions.sh
|
||||||
|
|
||||||
|
if [ "$DOCKER_ENV" != "true" ]; then
|
||||||
|
export_env_vars
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]; then
|
||||||
|
export DATABASE_URL
|
||||||
|
echo "Database URL: $DATABASE_URL"
|
||||||
|
./node_modules/.bin/prisma generate --schema=prisma/$DATABASE_PROVIDER-schema.prisma
|
||||||
|
else
|
||||||
|
echo "Error: Database provider $DATABASE_PROVIDER invalid."
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -31,7 +31,7 @@ RUN chmod +x ./Docker/scripts/*
|
|||||||
|
|
||||||
ENV DATABASE_CONNECTION_URI=postgres://postgres:pass@localhost/evolution
|
ENV DATABASE_CONNECTION_URI=postgres://postgres:pass@localhost/evolution
|
||||||
|
|
||||||
RUN ./Docker/scripts/deploy_database.sh
|
RUN ./Docker/scripts/generate_database.sh
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
@ -50,4 +50,4 @@ COPY --from=builder /evolution .
|
|||||||
|
|
||||||
ENV DOCKER_ENV=true
|
ENV DOCKER_ENV=true
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "-c", ". ./scripts/run_database_operation_deploy.sh && npm run start:prod" ]
|
ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user