Projet

Général

Profil

GitPackaging » Historique » Version 3

Daniel Dehennin, 10/01/2012 11:17
Proposition de workflow: utilisation de clef GPG pour autoriser la recompilation

1 1 Daniel Dehennin
h1. Gestion des paquets EOLE
2 1 Daniel Dehennin
3 2 Daniel Dehennin
h2. Environnement de compilation personel
4 1 Daniel Dehennin
5 2 Daniel Dehennin
Il existe plusieurs outils afin de mettre en place des environnements de compilation personels.
6 2 Daniel Dehennin
7 2 Daniel Dehennin
L’outil utilisé dans le projet "Debian":http://www.debian.org se nomme "sbuild":http://wiki.debian.org/sbuild.
8 2 Daniel Dehennin
9 2 Daniel Dehennin
Ce système peut se reposer sur un système de snapshot : on installe un système de base, propre, et la compilation se fait dans un snapshot temporarire de ce système.
10 2 Daniel Dehennin
11 2 Daniel Dehennin
Cela permet de lancer des compilations en parallèles au besoin.
12 2 Daniel Dehennin
13 2 Daniel Dehennin
Deux méthodes sont utilisables pour la mise en place des snapshots :
14 2 Daniel Dehennin
15 1 Daniel Dehennin
* [[eole:GitPackagingSbuildLVM|avec LVM]]
16 1 Daniel Dehennin
* [[eole:GitPackagingSbuildBtrfs|avec le système de fichier btrfs]]
17 2 Daniel Dehennin
18 2 Daniel Dehennin
19 2 Daniel Dehennin
Lorsque les schroots sont en place et sbuild configuré, la compilation d’un paquet peut se dérouler comme suit :
20 2 Daniel Dehennin
21 2 Daniel Dehennin
<pre>
22 2 Daniel Dehennin
buildd@build:~$ sudo apt-get install git-core git-buildpackage fakeroot build-essential debhelper cdbs
23 2 Daniel Dehennin
buildd@build:~$ git clone http://dev-eole.ac-dijon.fr/git/eole-debsums
24 2 Daniel Dehennin
buildd@build:~$ cd eole-debsums
25 2 Daniel Dehennin
buildd@build:~$ git checkout -b dist/ubuntu/lucid/build origin/dist/ubuntu/lucid/master
26 2 Daniel Dehennin
buildd@build:~$ git buildpackage --git-builder="sbuild -A -d eole2.3-dev" --git-cleaner=/bin/true
27 2 Daniel Dehennin
</pre>
28 3 Daniel Dehennin
29 3 Daniel Dehennin
h2. TODO Proposition de workflow
30 3 Daniel Dehennin
31 3 Daniel Dehennin
# Tag signé demandant le build d’un nouveau paquet
32 3 Daniel Dehennin
# Vérification de la signature: si nok => suppression du tag + report + quit
33 3 Daniel Dehennin
# Checkout du tag == récup de la conf gbp.conf
34 3 Daniel Dehennin
# Switch sur la branche de build
35 3 Daniel Dehennin
# Merge du tag dans la branche de build
36 3 Daniel Dehennin
# <pre>git-dch -a -R/-S debian/</pre>
37 3 Daniel Dehennin
# <pre>git add debian/changelog</pre>
38 3 Daniel Dehennin
# <pre>
39 3 Daniel Dehennin
git commit \
40 3 Daniel Dehennin
  -m "Nouveau paquet debian version: $(dpkg-parsechangelog | awk '/^Version/ {print $2}')"
41 3 Daniel Dehennin
</pre>
42 3 Daniel Dehennin
# <pre>
43 3 Daniel Dehennin
git buildpackage \
44 3 Daniel Dehennin
  --git-builder="sbuild -A -d $(dpkg-parsechangelog | awk '/^Distribution/ {print $2}')"
45 3 Daniel Dehennin
  --git-cleaner=/bin/true
46 3 Daniel Dehennin
</pre>
47 3 Daniel Dehennin
# Si build OK => git buildpackage --git-tag-only + git push