omgnetwork / omg-childchain-v2

pronounced /Ch-ch/
Apache License 2.0
5 stars 2 forks source link

Inomurko/public private releases #151

Closed InoMurko closed 3 years ago

InoMurko commented 3 years ago

Laying the ground work that will allow us to build two types of childchain relese images:

How does this work?

Building a release has two phases: The first phase is assembly in the builder image, getting dependencies and creating the tarball. The second phase is copying the tarbal into a bare alpine image (no elixir, erlang) and unpacking the tarball.

The problem I was solving was that while you're in the first phase (inside the builder image) you do not have any SSH keys and therfore no access to private git repositories. The solution volume mounts your local ssh keys and gives them to the builder image, it also forwards the SSH agent connection socket (both via volume and env var). Because OSX and Linux handle these things differently, that had to be solved with conditionals (at the top of the Makefile).

I also explicitly check that you don't commit these private repos (plugins) into mix.lock: https://github.com/omgnetwork/childchain/pull/147/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R120

Hopefully you guys try it out, I've tested this on Catalina and Ubuntu 20, Ubuntu 16 (cirleci). Make sure your agents are running: https://github.com/omgnetwork/childchain/pull/147/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R110-R113