Browse Source

initialize gitolite

Fabian Peter Hammerle 3 years ago
parent
commit
d91121a049
2 changed files with 6 additions and 0 deletions
  1. 1 0
      Dockerfile
  2. 5 0
      entrypoint.sh

+ 1 - 0
Dockerfile

@@ -26,6 +26,7 @@ VOLUME $SSHD_HOST_KEYS_DIR
 COPY sshd_config /etc/ssh/sshd_config
 EXPOSE 2200/tcp
 
+ENV GITOLITE_INITIAL_ADMIN_NAME=admin
 COPY entrypoint.sh /
 ENTRYPOINT ["/entrypoint.sh"]
 

+ 5 - 0
entrypoint.sh

@@ -9,6 +9,11 @@ if [ ! -f "$SSHD_HOST_KEYS_DIR/ed25519" ]; then
     ssh-keygen -t ed25519 -N '' -f "$SSHD_HOST_KEYS_DIR/ed25519"
 fi
 
+if [ ! -d "$HOME/.gitolite" ]; then
+    # > First run: either the pubkey or the admin name is *required*, [...]
+    (set -x; gitolite setup --admin "$GITOLITE_INITIAL_ADMIN_NAME")
+fi
+
 set -x
 
 exec "$@"