Created
September 20, 2012 08:08
-
-
Save dzaporozhets/3754594 to your computer and use it in GitHub Desktop.
This file contains 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
sudo adduser \ | |
--system \ | |
--shell /bin/sh \ | |
--gecos 'git version control' \ | |
--group \ | |
--disabled-password \ | |
--home /home/git \ | |
git | |
# ubuntu/debian | |
sudo adduser --disabled-login --gecos 'gitlab system' gitlab | |
sudo usermod -a -G git gitlab | |
sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa | |
cd /home/git | |
sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite | |
cd /home/git | |
sudo -u git -H mkdir bin | |
sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' | |
sudo -u git sh -c 'gitolite/install -ln /home/git/bin' | |
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | |
sudo chmod 0444 /home/git/gitlab.pub | |
sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub" | |
sudo -u git -H sed -i 's/0077/0007/g' /home/git/.gitolite.rc | |
sudo chmod -R g+rwX /home/git/repositories/ | |
sudo chown -R git:git /home/git/repositories/ | |
# clone admin repo to add localhost to known_hosts | |
# & be sure your user has access to gitolite | |
sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin | |
# if succeed you can remove it | |
sudo rm -rf /tmp/gitolite-admin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment