aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gitolite.html
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gitolite.html')
-rw-r--r--tools/gitolite.html102
1 files changed, 50 insertions, 52 deletions
diff --git a/tools/gitolite.html b/tools/gitolite.html
index 8616798..58d6d96 100644
--- a/tools/gitolite.html
+++ b/tools/gitolite.html
@@ -2,33 +2,28 @@
<html dir="ltr" lang="en">
<head>
<meta charset='utf-8'>
- <title>1. Gitolite</title>
+ <title>Gitolite</title>
</head>
<body>
<a href="index.html">Tools Index</a>
- <h1>1. Gitolite</h1>
+ <h1>Gitolite</h1>
- <h2 id="install">1.1. Install Gitolite</h2>
+ <h2 id="install">1. Install Gitolite</h2>
<p>Install <a href="../ports/gitolite/">Gitolite port</a> first;</p>
+
<pre>
$ prt-get depinst gitolite
</pre>
- <p>This setup is based on documentation from
- <a href="https://wiki.archlinux.org/index.php/Gitolite">Arch Wiki</a>. Mount point;</p>
-
- <pre>
- # mkdir -p /srv/gitolite
- # mount /srv/gitolite
- </pre>
+ <h2 id="config">2. Configure Gitolite</h2>
- <p>Create user;</p>
+ <p>Create user and home directory;</p>
<pre>
+ # mkdir -p /srv/gitolite
# useradd -U -d /srv/gitolite gitolite
- # passwd gitolite
# chown gitolite:gitolite /srv/gitolite
</pre>
@@ -36,10 +31,14 @@
locked and can login via ssh. This password
will not be used.</p>
- <h2 id="config">1.2. Configure Gitolite</h2>
+ <pre>
+ # passwd gitolite
+ </pre>
- <p>You need to copy a public key, read <a href="openssh.html#ssh">ssh</a>
- how to create one.</p>
+ <p>Copy public key that will be used for
+ authenticating gitolite administrator, read
+ <a href="openssh.html#ssh">ssh</a> how to
+ create one.</p>
<pre>
$ sudo install -o gitolite -g gitolite /home/bob/.ssh/gitolite.pub /srv/gitolite/gitolite.pub
@@ -66,7 +65,7 @@
$ ssh -v -i ~/.ssh/gitulite_rsa gitolite@localhost -p 2222
</pre>
- <h2 id="admin">1.3. Gitolite Administration</h2>
+ <h2 id="admin">3. Gitolite Administration</h2>
<p>Read how to setup <a href="openssh.html#sshid">ssh identities</a>,
<a href="http://gitolite.com/gitolite/gitolite.html#basic-admin">gitolite documentation</a>.
@@ -76,7 +75,7 @@
$ git clone gitolite:gitolite-admin
</pre>
- <h3>1.3.1. Recover Admin Account</h3>
+ <h3>3.1. Recover Admin Account</h3>
<p>First copy the key to remote server, in this example key is on
same server;</p>
@@ -97,13 +96,13 @@
$ exit
</pre>
- <h3 id="adminusers">1.3.2. Users</h3>
+ <h3 id="adminusers">3.2. Users</h3>
<p>Gitolite helps add and remove users from authorized_keys
by allowing add or remove keys from keydir directory in
clone.</p>
- <h4>Add User</h4>
+ <h4>3.2.1. Add User</h4>
<pre>
$ mv bob.pub keydir/
@@ -112,7 +111,7 @@
$ git push
</pre>
- <h4>Remove User</h4>
+ <h4>3.2.2. Remove User</h4>
<pre>
$ git rm keydir/bob.pub
@@ -120,9 +119,9 @@
$ git push
</pre>
- <h3 id="adminrep">1.3.3. Repositories</h3>
+ <h3 id="adminrep">3.3. Repositories</h3>
- <h4>Add Repository</h4>
+ <h4>3.3.1. Add Repository</h4>
<p>Add repository atom and user bob to devteam group,
edit conf/gitolite.conf;</p>
@@ -169,8 +168,7 @@
$ git push
</pre>
- <p>
- <h4>Rename Repository</h4>
+ <h4>3.3.2 Rename Repository</h4>
<p>Rename rep void to sysdoc, on remote host;</p>
@@ -193,12 +191,12 @@
$ git push
</pre>
- <h2 id="hooks">1.4. Gitolite Hooks</h2>
+ <h2 id="hooks">4. Gitolite Hooks</h2>
<p>Example from
<a href="http://gitolite.com/gitolite/cookbook.html#v3.6-variation-repo-specific-hooks">Cookbook</a>
how to apply hooks only to certain repos. Uncomment or add
- this line on /srv/gitolite/.gitolite.rc, within the %RC block;</p>
+ this line on /srv/gitolite/.gitolite.rc, within the %RC block;</p>
<pre>
LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",
@@ -234,7 +232,7 @@
git "standard" names (pre-receive, post-receive, post-update),
you use descriptive names (e.g. "deploy", "RSS-post", etc).</p>
- <h3 id="gtl-deploy">1.4.1. Deploy Hook</h3>
+ <h3 id="gtl-deploy">4.1. Deploy Hook</h3>
<p>This manual create two users; one gitolite that handle git
central server and system www for web servers. To avoid permission
@@ -242,9 +240,9 @@
we have permission to use chown, this way files end up with right
www user ownership and permissions.</p>
- <p>This hook allows to select wich branch is deployed and if exists,
- calls a script inside project folder with user www. This allows to
- do post deploy (checkout) tasks such as composer update.</p>
+ <p>This hook allows to select wich branch is deployed and if exists,
+ calls a script inside project folder with user www. This allows to
+ do post deploy (checkout) tasks such as composer update.</p>
<p>Create <a href="../conf/srv/gitoliteolite/deployweb">deployweb</a>
in gitolite-admin/local/hooks/repo-specific;</p>
@@ -254,29 +252,29 @@
</pre>
<pre>
- #!/bin/bash
+ #!/bin/bash
- ######################################################################
- #
- # Put this file in your gitolite-admin;
- # ~/gitolite-admin/local/hooks/repo-specific/deployweb
- #
- while read oldrev newrev refname
- do
- BRANCH=$(git rev-parse --symbolic --abbrev-ref $refname)
- echo "Commit was for branch $BRANCH"
+ ######################################################################
+ #
+ # Put this file in your gitolite-admin;
+ # ~/gitolite-admin/local/hooks/repo-specific/deployweb
+ #
+ while read oldrev newrev refname
+ do
+ BRANCH=$(git rev-parse --symbolic --abbrev-ref $refname)
+ echo "Commit was for branch $BRANCH"
- if [[ "$BRANCH" == "master" ]];then
+ if [[ "$BRANCH" == "master" ]];then
- # Get project name from current directory (without .git)
- PROJECT=$(basename "$PWD")
- PROJECT=${PROJECT%.git}
+ # Get project name from current directory (without .git)
+ PROJECT=$(basename "$PWD")
+ PROJECT=${PROJECT%.git}
- echo "Project $PROJECT added to deploy list."
- echo $PWD &gt; /srv/gitolite/deploy/$PROJECT
- fi
+ echo "Project $PROJECT added to deploy list."
+ echo $PWD &gt; /srv/gitolite/deploy/$PROJECT
+ fi
- done
+ done
</pre>
<p>Create deploy directory on remote;</p>
@@ -422,10 +420,10 @@
<a href="index.html">Tools Index</a>
<p>This is part of the c9-doc Manual.
- Copyright (C) 2016
- c9 team.
- See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
- for copying conditions.</p>
+ Copyright (C) 2016
+ c9 team.
+ See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
+ for copying conditions.</p>
</body>
</html>