about summary refs log tree commit diff
path: root/services
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-18T19·37+0000
committerVincent Ambo <tazjin@google.com>2019-12-18T19·37+0000
commit9448326b9b841bf00def7803d9a18248b733c33c (patch)
tree4f5c8bbd3d02bad0a0869632cf582c6a093f72a8 /services
parent51ad58f8de96021b0d27cb06a260056f8bd515f4 (diff)
feat(cgit-taz): Clone depot on container launch r/189
This makes for a pretty static server for now, but we'll get there.
Diffstat (limited to 'services')
-rw-r--r--services/cgit-taz/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/cgit-taz/default.nix b/services/cgit-taz/default.nix
index e441fbff6679..3ac1be0b8943 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 <tazjin@google.com>
-    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}
 # ''