From 9448326b9b841bf00def7803d9a18248b733c33c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 18 Dec 2019 19:37:41 +0000 Subject: feat(cgit-taz): Clone depot on container launch This makes for a pretty static server for now, but we'll get there. --- services/cgit-taz/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/cgit-taz/default.nix b/services/cgit-taz/default.nix index e441fbff66..3ac1be0b89 100644 --- a/services/cgit-taz/default.nix +++ b/services/cgit-taz/default.nix @@ -19,7 +19,7 @@ let repo.path=/srv/git/depot repo.desc=tazjin's personal monorepo repo.owner=tazjin - repo.clone-url=ssh://source.developers.google.com:2022/p/tazjins-infrastructure/r/depot + repo.clone-url=https://git.tazj.in ssh://source.developers.google.com:2022/p/tazjins-infrastructure/r/depot ''; thttpdConfig = writeText "thttpd.conf" '' port=8080 @@ -54,5 +54,13 @@ let patches = [ ./cgit_idx.patch thttpdConfigPatch ]; }); in writeShellScriptBin "cgit-launch" '' + ${coreutils}/bin/mkdir -p /srv/git + + # The cookie file is placed in the correct location by Kubernetes, based on + # information stored in a secret. + ${git}/bin/git clone --mirror -c http.cookieFile=/var/cgit/gitcookies \ + https://source.developers.google.com/p/tazjins-infrastructure/r/depot \ + /srv/git/depot + exec ${thttpdCgit}/bin/thttpd -D -C ${thttpdConfig} # '' -- cgit 1.4.1