BurntSushi / erd

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.
The Unlicense
1.79k stars 154 forks source link

build Docker image and publish to GitHub registry #108

Closed marzocchi closed 1 year ago

marzocchi commented 3 years ago

This adds a workflow to build erd's Docker image and publish it to GitHub's registry and resolves #104.

To Do

marzocchi commented 3 years ago

hi @mmzx, @BurntSushi!

I thought this might help making erd more approachable, as building locally can take quite some time and resources. It's not complete (see To Do), but let me know if you are interested in merging this PR and your preference for tags and when to trigger it.

To note:

And this is an usage example:

docker run -i ghcr.io/marzocchi/erd:latest <<EOF >| out.pdf
[Person]
*name
+birth_place_id
EOF
mmzx commented 3 years ago

I think the idea is nice. The choice of base image is important, to have the necessary ghc version and a corresponding build tool. Let me follow up...

marzocchi commented 3 years ago

sure! well anyway the workflow builds the Dockerfile from the root of the repo, so haskell:8

fbartho commented 2 years ago

@marzocchi / @mmzx — did this work ever reach completion? I’m interested in pulling this tool or something like it in, for generating DB Schema Images in our Github PRs

We don’t currently have many haskell experts on our team, and I wouldn’t expect people to have a working haskell environment either, locally, so using it via Github Actions would be ideal.

marzocchi commented 2 years ago

hi @fbartho, there was no further development but I'm ready to wrap it up as soon as @mmzx's follows up on the choice of base image

abbluiz commented 2 years ago

I'm curious whether the image will support arm architecture

mmzx commented 1 year ago

Sorry for slacking off here! - somehow missed it. I've made some experiment today using the haskell:8 base image, that could be used for the purpose of the PR. Anyone, who would be still interested doing it?

marzocchi commented 1 year ago

hi @mmzx, I updated the workflow's dependencies and it now builds when a tag matching vX.X.X is pushed (also works when making a release on GitHub as long as the expected tag is created). The image will be tagged with latest and the tag for which it was built (see v0.0.4 here for an example).

I also updated the docker example in the README.

Note that the Dockerfile used by the workflow is the one already existing in the root of the repo, which already uses haskell:8.

mmzx commented 1 year ago

Brilliant, thank you very much!

felixvanoost commented 1 year ago

@mmzx Are there any plans to release a new tag in the forseeable future so that the workflow merged in this PR gets triggered?

If so, I would like to submit a PR to additionally build and release arm64 variants of the Docker images based on the work done here.

mmzx commented 1 year ago

@FelixVanOost , go ahead with your PR. I will trigger the release build then!