esl / mongooseim-docker

Apache License 2.0
27 stars 29 forks source link

Not able to build the mongooseim when repo is a private repo #37

Closed anildigital closed 1 year ago

anildigital commented 4 years ago

Not able to build the mongooseim when the repo is a private repo

docker exec -i mongooseim-builder /build.sh project_name repo commit

I am running our app named 'foo'

docker exec -i mongooseim-builder /build.sh foo https://gitlab.com/backend/foo.git 1567137e7337453d65373e00dacfd79f2d64a457

I get the following error.

Cloning into '/tmp/mongooseim'...
fatal: could not read Username for 'https://gitlab.com/': No such device or address
[2020-08-10 01:21:31] build failed

I tried creating ssh keys inside a docker container and putting the public key in Gitlab and then

I tried using the git protocol URL as

docker exec -i mongooseim-builder /build.sh foo git@gitlab.com:backend/foo.git 1567137e7337453d65373e00dacfd79f2d64a457

It gets stuck at

[2020-08-10 01:26:01] do_build: chat 1567137e7337453d65373e00dacfd79f2d64a457 git@gitlab.com:backend/foo.git
Cloning into '/tmp/mongooseim'

Nothing seems helping.

chrzaszcz commented 1 year ago

Hi @anildigital. Firstly, I would like to apologise for not answering for a long time - this is a helper repo for MongooseIM, and we are rarely checking the issues.

/build.sh is a script that you can execute inside mongooseim-builder, so you can:

  1. Copy your SSH key, e.g. docker cp ~/.ssh/YOUR_PRIVATE_KEY mongooseim-builder:/root/.ssh/. Make sure to remove the key afterwards, so it is not compromised. You can share the key in a volume as well.
  2. Execute the build script: docker exec -i mongooseim-builder /build.sh foo git@gitlab.com:backend/foo.git 1567137e7337453d65373e00dacfd79f2d64a457.

You can execute bash on the container as well, which would allow you to set up the repo credentials, and then you can just call /build.sh.

Finally, you can just edit /build.sh on the builder container before executing it.

I am closing this issue, because there are multiple workarounds, and it has been a long time since it was reported.