From 48a050ce041a0efe41047b3d9cac4b70b617b6ae Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sat, 15 Jan 2022 21:24:49 -0800 Subject: [PATCH] Download ssh deps over http, allow passing in credentials --- docker/common.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/common.sh b/docker/common.sh index 16396a8a9..093015f3c 100755 --- a/docker/common.sh +++ b/docker/common.sh @@ -36,3 +36,13 @@ if_ubuntu install_packages \ g++ \ libc6-dev \ pkg-config + +# Allow for passing in git credentials via environment variable in the format described here https://git-scm.com/docs/git-credential-store#_storage_format +cat <<'EOF' >/usr/local/bin/git_env_credential +#!/bin/bash +echo url=$GIT_CREDENTIALS +EOF + +chmod +x /usr/local/bin/git_env_credential +git config --system credential.helper "/usr/local/bin/git_env_credential" +git config --system url."https://".insteadOf ssh://git@