diff --git a/src/gl-easy-install b/src/gl-easy-install index 82ec154..37cff34 100755 --- a/src/gl-easy-install +++ b/src/gl-easy-install @@ -104,11 +104,16 @@ Usage: $0 [-q] user host [port] admin_name # install config file. For upgrades (ie., gitolite is already installed on the server), this argument is not needed, and will be *ignored* if provided. -Example usage: $0 git my.git.server sitaram + - (optional) "host_nickname" is a nickname that can be given to a particular + installation of gitolite. This allows for multiple servers to easily be + administered from this machine. Defaults to "gitolite" + +Example usage: $0 git my.git.server sitaram [gitolite_server_1] Notes: - - "user" and "admin_name" must be simple names -- no special characters etc - please (only alphanumerics, dot, hyphen, underscore) + - "user","admin_name" and "host_nickname" must be simple names -- no + special characters etc please (only alphanumerics, dot, hyphen, + underscore) - traditionally, the "user" is "git", but it can be anything you want - "admin_name" should be your name, for clarity, or whoever will be the gitolite admin @@ -152,12 +157,23 @@ basic_sanity() { host=$2 port=22 admin_name=$3 + host_nickname=$4 + if [ -z $4 ] + then + host_nickname="gitolite" + fi + # but if the 3rd arg is a number, that's a port number, and the 4th arg is # the admin_name if echo $3 | perl -lne 'exit 1 unless /^[0-9]+$/' then port=$3 admin_name=$4 + host_nickname=$5 + if [ -z $5 ] + then + host_nickname=gitolite + fi fi echo $user | perl -lne 'exit 1 if /[^a-zA-Z0-9._-]/' || @@ -165,6 +181,8 @@ basic_sanity() { [[ "$user" == "root" ]] && die I refuse to install to root echo $admin_name | perl -lne 'exit 1 if /[^a-zA-Z0-9._-]/' || die "admin_name '$admin_name' invalid" + echo $host_nickname | perl -lne 'exit 1 if /[^a-zA-Z0-9._-]/' || + die "host nickname '$host_nickname' invalid" # MANUAL: make sure you're in the gitolite directory, at the top level. # The following files should all be visible: @@ -260,13 +278,13 @@ setup_local_ssh() { # port 22 # identityfile ~/.ssh/sitaram - echo "host gitolite + echo "host $host_nickname user $user hostname $host port $port identityfile ~/.ssh/$admin_name" > $tmpgli/.gl-stanza - if grep 'host *gitolite' "$HOME/.ssh/config" &>/dev/null + if grep "host *$host_nickname" "$HOME/.ssh/config" &>/dev/null then prompt "found gitolite para in ~/.ssh/config; assuming it is correct..." "$v_found_para" else @@ -437,12 +455,12 @@ clone_it() { cleanup cd "$HOME" - if [[ -d gitolite-admin ]] + if [[ -d $host_nickname-admin ]] then - echo $HOME/gitolite-admin exists, skipping clone step... + echo $HOME/$host_nickname-admin exists, skipping clone step... else - prompt "cloning gitolite-admin repo..." "$v_cloning" - git clone gitolite:gitolite-admin + prompt "cloning $host_nickname-admin repo..." "$v_cloning" + git clone $host_nickname:gitolite-admin $host_nickname-admin fi # MANUAL: be sure to read the message below; this applies to you too... @@ -574,7 +592,11 @@ done! IMPORTANT NOTE -- PLEASE READ!!! *Your* URL for cloning any repo from this server will be - gitolite:reponame.git + \$host_nickname:reponame.git + + Note: If you are upgrading and you set a host nickname during initial + setup, please use that host nickname instead of \"gitolite\" + above. *Other* users you set up will have to use \$user@\$host:reponame.git