summaryrefslogblamecommitdiffstats
path: root/configure
blob: 53d8e1c13a278ec76c5c7bbbfb43f5124986607d (plain) (tree)





















                                                                            
#!/bin/sh

usage() {
    echo "usage: ./configure <ssh-pubkey>"
    echo "Please give me your administrator public key, whose filename must"
    echo "end in '.pub'.  Paths beginning with '~' are not allowed, however"
    echo "your shell might pre-expand them."
    exit 1
}

echo "$1" | grep -Eq '^~' && usage
echo "$1" | grep -Eq '.+\.pub$' || usage

echo "$1" | grep -Eq '^/' && keypath="$1" || keypath="$PWD/$1"
keyname=$(basename "$keypath")

docker compose run \
    --build \
    --rm \
    --volume "$keypath:/tmp/$keyname:ro" \
    gitolite \
    /app/initialize.sh "$keyname"