Fork me on GitHub
#polylith
<
2021-08-24
>
eraad15:08:13

Hi! I would appreciate if anyone could share their experience deploying a polylith project to Ions

eraad15:08:20

I’m having trouble doing it naively, the code (components, bases) do not get into the app directory from the ion artifact, but in the root, so they are not found in the classpath

furkan3ayraktar17:08:33

First of all, which version of Datomic ions are you using? We are quite a bit behind of the current version (668-8927). Another thing is, Datomic does not fully support monorepos. That’s said, there is an easy way to go around it. Normally, Datomic expects a git repository per application to deploy. However, in Polylith, you may have multiple projects that represent multiple Datomic applications living under the same monorepo. We currently have 3 different Polylith projects that we use with Datomic Ions. One is deployed as Primary Group and other two are deployed as different Query Groups for different purposes under the same Datomic system. What we do is, we keep each Datomic configuration under projects/PROJECT_NAME/resources/datomic/ion-config.edn. Each project also have :ion-dev alias in their own deps.edn file. Then, we use the unreproducible push/deploy with Datomic to deploy our changes, since otherwise, all projects will have the same revision id due to the fact that Datomic uses the git commit for deployments. In order to make those unreproducible deployments reproducible on our side, we create unique revision names ourselves in a format such as BRANCH_NAME-SHA-PROJECT_NAME. We created a simple bash script where we push and deploy using the method above. We deploy the project by writing on terminal: ./ion-deploy.sh backend where backend is one of the projects in our Polylith workspace.

furkan3ayraktar17:08:30

Here is the script that we use to deploy, if it helps.

eraad18:08:26

Thank you! This certainly provides me a way forward. Will try it an report back!

tengstrand16:08:32

@furkan3ayraktar is the right person to answer this.

eraad16:08:12

Thanks!

👍 3