Hey :wave: I am just integrating Prisma in our wor...
# orm-help
o
Hey šŸ‘‹ I am just integrating Prisma in our workflow and have a question about the CLI commands and where in our CI/CD to run them.
npx prisma db pull
for example needs to connect to the database which is running inside of our Kubernetes cluster. As we are using TLS certificates to authenticate the client (node app in this example) with the database, we don’t have access to those certificates in our build process. Where should I run those commands? Am I missing something here? Similar question about
npx prisma migrate deploy
. Thank you for your help!
āž• 1
āœ… 1
j
Hey Oscar! Usually it’s a good idea to run it after the build process because your build could fail and in that case you would probably not want to have any database changes applied
I don’t have a clear answer though because it really depends on your infrastructure.
o
Hey Joƫl, thanks for the quick reply! You are talking about
prisma migrate
right? My idea here is to use an initContainer so that the migration happens on pod startup. Does
prisma migrate deploy
write to the file system?
šŸ‘ 1
j
Right I was talking about
prisma migrate deploy
prisma migrate deploy
only connects to your database, checks the current state of migrations and if there are not yet applied migrations, apply them. So read only for filesystem
Note that it’s ok to run it concurrently, even though it’s probably not useful. Since the first one will get a ā€œlockā€ and the next ones will wait. and if there is nothing to apply -> success.
About
prisma db pull
why are you running it in CI/CD? I’m curious to understand what you are using it for here
d
@Oscar Stahlberg @Joƫl are you running it similar to this workaround? there's no programmatic way of doing this right?
j
@Danily
there’s no programmatic way of doing this right?
No, though technically yes but it’s not a supported API nor documented and we will break it in the future. But we’re very interested in your use case, if you can share it here or in the issue! šŸ“ So we can have all the feedback we can to design it properly.