Tags

arm bin_sh blocage blosxom bsd bsdfrance cblog certification chroot cluster dg834 dhcp dns dnsmasq dovecot fail-over fail2ban firefox freebsd ftp git guruplug install ipv6 jail kernel kimsufi lex libre linutop makefile ml150 mohawk netbook netbsd nginx ntp ntp.org openbsd openntpd openrd openwrt pkgng poudriere proxy python reverse rmll route rrdcgi sendmail sieve sl2009 ssd symon update usb var_empty vimperator world xen yacc zfs

Powered by

blOg
maRdown
awK
shEll

15/01/2010

[ git ]

201001151241 git

FreeBSD, git et depot public

Une jail vite fait sur le gaz:
ks34581# ./bin/mk_jail.sh repo 10240 repo.bsdsx.fr 172.16.0.15
ks34581# grep git /etc./pf.conf
git="9418"
rdr pass on $ext_if proto tcp from !  to port $git -> 172.16.0.15

Installation de git en 2 coups les gros:
repo# pkg_add -r git

La configuration du dépôt sera la suivante:

/etc/rc.conf:
git_daemon_enable="YES"
git_daemon_directory=""
git_daemon_flags="--syslog --export-all --enable=receive-pack --listen=172.16.0.15 --verbose --base-path=/home/git/repo"
Il faut retoucher /usr/local/etc/rc.d/git-daemon pour ne pas utiliser la variable git_daemon_directory:
command_args="${git_daemon_flags} &"
Un /usr/local/etc/rc.d/git-daemon start plus tard, on peut récupérer un dépôt:
git@repo> cd && cd repo && git clone --bare http://git.etoilebsd.net/cgit/cblog
Dans la jail de dev:
dsx@devel> cd && cd src/git && git clone git://repo.bsdsx.fr/cblog
dsx@devel> cd cblog
dsx@devel> vim *.c
dsx@devel> git commit -m 'style' -a
dsx@devel> git push
Voilà mon dépôt à jour. Mais comment puis-je récupérer les mises à jour de http://git.etoilebsd.net/cgit/cblog ? Il me suffit de rajouter un remote:
dsx@devel> git remote add etoilebsd http://git.etoilebsd.net/cgit/cblog
dsx@devel> git pull etoilebsd master

Je pense avoir zappé la phase "accès à repo.bsdsx.fr depuis devel.bsdsx.fr" (ma clef ssh est dans /usr/share/skel/dot.ssh/authorized_keys) mais google est notre ami à tous.

Update: http://git.etoilebsd.net/cgit/cblog devient http://git.etoilebsd.net/cblog.
dsx@devel> git remote rm etoilebsd
dsx@devel> git remote add etoilebsd http://git.etoilebsd.net/cblog
dsx@devel> git pull etoilebsd master
From http://git.etoilebsd.net/cblog
 * branch            master     -> FETCH_HEAD
Updating 916889e..b252008
Fast forward
 Makefile           |    2 +-
 cgi/Makefile       |    8 +-
 cgi/cblog_cgi.c    |  335 +++++++++++++++++++++++++++------------------------
 cgi/cblog_cgi.h    |    9 +-
 cli/Makefile       |    6 +-
 cli/cblogctl.c     |  201 ++++++++++++-------------------
 cli/cblogctl.h     |   67 -----------
 cli/main.c         |   97 +++++++++------
 lib/Makefile       |   11 ++
 lib/cblog_common.h |   13 ++
 lib/cblog_utils.h  |   11 ++
 lib/db.c           |   21 ++++
 lib/utils.c        |   58 +++++++++
 13 files changed, 437 insertions(+), 402 deletions(-)
 create mode 100644 lib/Makefile
 create mode 100644 lib/cblog_common.h
 create mode 100644 lib/cblog_utils.h
 create mode 100644 lib/db.c
 create mode 100644 lib/utils.c

Lien vers ce billet