Created
January 4, 2013 10:58
-
-
Save hvnsweeting/4451660 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from fabric.api import * | |
def host(): | |
env.hosts = ["192.168.122.158"] | |
#env.password = {'[email protected]': 'hehehe', '[email protected]':'hehehe'} | |
env.passwords = {'[email protected]': 'hehehe', '[email protected]':'hehehe'} | |
def gitolite(): | |
run('grep "git:" /etc/passwd') | |
sudo('userdel -f git', warn_only=True) | |
sudo('rm -rf /home/git', warn_only=True) | |
sudo('apt-get install -y git') | |
sudo('useradd -m git') | |
sudo('passwd git') | |
with settings(user='git'): | |
run('cd ~') | |
run("rm ~/.ssh/authorized_keys", warn_only=True) | |
run('git clone git://github.com/sitaramc/gitolite.git') | |
local('scp ~/.ssh/id_rsa.pub git@' + env.hosts[0] + ':/home/git/id_rsa.pub') | |
run('mkdir -p $HOME/bin') | |
run('gitolite/install -to $HOME/bin') | |
run('gitolite setup -pk id_rsa.pub') | |
run('./gitolite/install -to $HOME/bin') | |
run('$HOME/bin/gitolite setup -pk id_rsa.pub') | |
#local('git clone [email protected]:gitolite-admin') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment