L'installation de gitolite » Historique » Version 1
Yanick Delarbre, 09/11/2011 12:28
1 | 1 | Yanick Delarbre | h1. L'installation de gitolite |
---|---|---|---|
2 | 1 | Yanick Delarbre | |
3 | 1 | Yanick Delarbre | <pre> |
4 | 1 | Yanick Delarbre | # dpkg-reconfigure locales Règles le warning à propos des locales non configurés |
5 | 1 | Yanick Delarbre | #La clé de l'admin |
6 | 1 | Yanick Delarbre | client$ .ssh/id_rsa.pub root@rhizome-fai.net:/tmp/nebula.pub |
7 | 1 | Yanick Delarbre | server# apt-get install gitolite -y |
8 | 1 | Yanick Delarbre | server# su - gitolite |
9 | 1 | Yanick Delarbre | #Initialisation du repository admin |
10 | 1 | Yanick Delarbre | gitolite@server$ gl-setup /tmp/nebula.pub |
11 | 1 | Yanick Delarbre | |
12 | 1 | Yanick Delarbre | client$ git clone gitolite@rhizome-fai.tetaneutral.net:gitolite-admin.git |
13 | 1 | Yanick Delarbre | client$ cd gitolite-admin |
14 | 1 | Yanick Delarbre | #Les clés des clients |
15 | 1 | Yanick Delarbre | client$ mv cle.pub key/ |
16 | 1 | Yanick Delarbre | #La configuration de chaque repository |
17 | 1 | Yanick Delarbre | client$ vim conf/gitolite.conf |
18 | 1 | Yanick Delarbre | repo gitolite-admin |
19 | 1 | Yanick Delarbre | RW+ = user |
20 | 1 | Yanick Delarbre | |
21 | 1 | Yanick Delarbre | repo testing |
22 | 1 | Yanick Delarbre | RW+ = @all |
23 | 1 | Yanick Delarbre | |
24 | 1 | Yanick Delarbre | repo agregation |
25 | 1 | Yanick Delarbre | RW+ = user nebula jocelyn fernando |
26 | 1 | Yanick Delarbre | R = daemon |
27 | 1 | Yanick Delarbre | |
28 | 1 | Yanick Delarbre | client$ git add conf/gitolite.conf key/* |
29 | 1 | Yanick Delarbre | client$ git commit -m "add repo agregation + git-daemon in R" |
30 | 1 | Yanick Delarbre | #Note: toutes la confiration s'applique grâce à un hook. Donc il suffit de "pusher" la configuration vers le serveur |
31 | 1 | Yanick Delarbre | client$ git push |
32 | 1 | Yanick Delarbre | |
33 | 1 | Yanick Delarbre | #Rendre le repository public |
34 | 1 | Yanick Delarbre | server# apt-get install git-daemon-run -y |
35 | 1 | Yanick Delarbre | server# vim /etc/init.d/git-daemon |
36 | 1 | Yanick Delarbre | |
37 | 1 | Yanick Delarbre | </pre> |
38 | 1 | Yanick Delarbre | |
39 | 1 | Yanick Delarbre | Le fichier git-daemon pour éviter d'utliser sv. |
40 | 1 | Yanick Delarbre | |
41 | 1 | Yanick Delarbre | <pre> |
42 | 1 | Yanick Delarbre | #!/bin/sh |
43 | 1 | Yanick Delarbre | |
44 | 1 | Yanick Delarbre | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:\ |
45 | 1 | Yanick Delarbre | /usr/bin:/usr/lib/git-core |
46 | 1 | Yanick Delarbre | NAME=git-daemon |
47 | 1 | Yanick Delarbre | PIDFILE=/var/run/$NAME.pid |
48 | 1 | Yanick Delarbre | DESC="git daemon" |
49 | 1 | Yanick Delarbre | DAEMON=/usr/lib/git-core/git-daemon |
50 | 1 | Yanick Delarbre | DAEMON_OPTS="--base-path=/var/lib/gitolite/repositories --verbose \ |
51 | 1 | Yanick Delarbre | --syslog --detach --pid-file=$PIDFILE --user=gitolite \ |
52 | 1 | Yanick Delarbre | --group=nogroup --enable=receive-pack" |
53 | 1 | Yanick Delarbre | |
54 | 1 | Yanick Delarbre | test -x $DAEMON || exit 0 |
55 | 1 | Yanick Delarbre | |
56 | 1 | Yanick Delarbre | [ -r /etc/default/git-daemon ] && . /etc/default/git-daemon |
57 | 1 | Yanick Delarbre | |
58 | 1 | Yanick Delarbre | . /lib/lsb/init-functions |
59 | 1 | Yanick Delarbre | |
60 | 1 | Yanick Delarbre | start_git() { |
61 | 1 | Yanick Delarbre | start-stop-daemon --start --quiet --pidfile $PIDFILE \ |
62 | 1 | Yanick Delarbre | --startas $DAEMON -- $DAEMON_OPTS |
63 | 1 | Yanick Delarbre | } |
64 | 1 | Yanick Delarbre | |
65 | 1 | Yanick Delarbre | stop_git() { |
66 | 1 | Yanick Delarbre | start-stop-daemon --stop --quiet --pidfile $PIDFILE |
67 | 1 | Yanick Delarbre | rm -f $PIDFILE |
68 | 1 | Yanick Delarbre | } |
69 | 1 | Yanick Delarbre | |
70 | 1 | Yanick Delarbre | status_git() { |
71 | 1 | Yanick Delarbre | start-stop-daemon --stop --test --quiet --pidfile $PIDFILE >/dev/null 2>&1 |
72 | 1 | Yanick Delarbre | } |
73 | 1 | Yanick Delarbre | |
74 | 1 | Yanick Delarbre | case "$1" in |
75 | 1 | Yanick Delarbre | start) |
76 | 1 | Yanick Delarbre | log_begin_msg "Starting $DESC" |
77 | 1 | Yanick Delarbre | start_git |
78 | 1 | Yanick Delarbre | log_end_msg 0 |
79 | 1 | Yanick Delarbre | ;; |
80 | 1 | Yanick Delarbre | stop) |
81 | 1 | Yanick Delarbre | log_begin_msg "Stopping $DESC" |
82 | 1 | Yanick Delarbre | stop_git |
83 | 1 | Yanick Delarbre | log_end_msg 0 |
84 | 1 | Yanick Delarbre | ;; |
85 | 1 | Yanick Delarbre | status) |
86 | 1 | Yanick Delarbre | log_begin_msg "Testing $DESC: " |
87 | 1 | Yanick Delarbre | if status_git |
88 | 1 | Yanick Delarbre | then |
89 | 1 | Yanick Delarbre | log_success_msg "Running" |
90 | 1 | Yanick Delarbre | exit 0 |
91 | 1 | Yanick Delarbre | else |
92 | 1 | Yanick Delarbre | log_failure_msg "Not running" |
93 | 1 | Yanick Delarbre | exit 1 |
94 | 1 | Yanick Delarbre | fi |
95 | 1 | Yanick Delarbre | ;; |
96 | 1 | Yanick Delarbre | restart|force-reload) |
97 | 1 | Yanick Delarbre | log_begin_msg "Restarting $DESC" |
98 | 1 | Yanick Delarbre | stop_git |
99 | 1 | Yanick Delarbre | sleep 1 |
100 | 1 | Yanick Delarbre | start_git |
101 | 1 | Yanick Delarbre | log_end_msg 0 |
102 | 1 | Yanick Delarbre | ;; |
103 | 1 | Yanick Delarbre | *) |
104 | 1 | Yanick Delarbre | echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 |
105 | 1 | Yanick Delarbre | exit 1 |
106 | 1 | Yanick Delarbre | ;; |
107 | 1 | Yanick Delarbre | esac |
108 | 1 | Yanick Delarbre | |
109 | 1 | Yanick Delarbre | exit 0 |
110 | 1 | Yanick Delarbre | </pre> |
111 | 1 | Yanick Delarbre | |
112 | 1 | Yanick Delarbre | <pre> |
113 | 1 | Yanick Delarbre | server# update-rc.d git-daemon default |
114 | 1 | Yanick Delarbre | |
115 | 1 | Yanick Delarbre | # Pour cloner le repository |
116 | 1 | Yanick Delarbre | client_git_public$ git clone git://rhizome-fai.tetaneutral.net/agregation.git |
117 | 1 | Yanick Delarbre | client_git_user$ git clone gitolite@rhizome-fai.tetaneutral.net:agregation.git |
118 | 1 | Yanick Delarbre | |
119 | 1 | Yanick Delarbre | </pre> |
120 | 1 | Yanick Delarbre | |
121 | 1 | Yanick Delarbre | h2. Les sources |
122 | 1 | Yanick Delarbre | |
123 | 1 | Yanick Delarbre | http://doc.ubuntu-fr.org/gitolite#rendre_un_depot_public |
124 | 1 | Yanick Delarbre | http://computercamp.cdwilson.us/git-gitolite-git-daemon-gitweb-setup-on-ubunt |