Empaquetage paquets binaires OK
This commit is contained in:
parent
2cff8041dc
commit
913945a08c
57
README.md
57
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Tamarin
|
# Tamarin
|
||||||
|
|
||||||
Usine à paquets Debian basée sur Docker.
|
Usine à paquets binaires Debian basée sur Docker.
|
||||||
|
|
||||||
## Dépendances
|
## Dépendances
|
||||||
|
|
||||||
|
@ -9,53 +9,18 @@ Vous devez avoir [docker](https://docs.docker.com/installation/) installé sur v
|
||||||
## Utilisation
|
## Utilisation
|
||||||
|
|
||||||
```
|
```
|
||||||
./package-project.sh <src> <dist> <docker_image>
|
Usage: ./package.sh -p project_path [-d destination] [-i image] [-k]
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
-p Path to the project to build
|
||||||
|
-d Optional : Destination of the builed packages (default ./packages)
|
||||||
|
-i Optional : Name of the Docker image to use for build (default: debian:jessie)
|
||||||
|
-k Optional : Keep the Docker container after build
|
||||||
|
-b Optional : Build directory (default /tmp)
|
||||||
|
-B Optional : Build branch (for git projects only) (default dist/ubuntu/precise/master)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Exemple:** *en étant placé dans le répertoire du projet Tamarin*
|
|
||||||
```
|
|
||||||
./package-project.sh ./src-example ./dist "debian:jessie"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Le fichier manifeste `tamarin.json`
|
|
||||||
|
|
||||||
La génération des fichiers de métadonnées nécessaires à la construction du paquet peut être semi-automatisé via l'ajout d'un fichier manifeste `tamarin.json` à la racine du projet.
|
|
||||||
|
|
||||||
Si le répertoire `DEBIAN` est déjà présent à la racine du projet, Tamarin n'effectuera pas cette étape.
|
|
||||||
|
|
||||||
Ce fichier à la structure suivante:
|
|
||||||
|
|
||||||
```js
|
|
||||||
{
|
|
||||||
"name": "hello-world", // Nom du projet
|
|
||||||
"version": "0.0.0", // Version
|
|
||||||
"dependencies": { // Dépendances du projet suivant la distribution cible
|
|
||||||
"debian:jessie": [
|
|
||||||
"apache2 (>= 2.4)",
|
|
||||||
"php5 (>= 5.4)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hooks": { // Hooks liés au cycle de vie du paquet
|
|
||||||
"preBuild": "./scripts/pre-build.sh",
|
|
||||||
"postBuild": "./scripts/post-build.sh",
|
|
||||||
"preInstall": "",
|
|
||||||
"preRemove": "",
|
|
||||||
"postInstall": "",
|
|
||||||
"postRemove": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
### Les hooks
|
|
||||||
|
|
||||||
|Hook |Contexte |Description|
|
|
||||||
|------------|---------------------------------------------------|-----------|
|
|
||||||
|preBuild |Exécuté dans le conteneur de construction du paquet|TODO|
|
|
||||||
|postBuild |Exécuté dans le conteneur de construction du paquet|TODO|
|
|
||||||
|preInstall |Exécuté juste avant l'installation du paquet |TODO|
|
|
||||||
|postInstall |Exécuté juste après l'installation du paquet |TODO|
|
|
||||||
|preRemove |Exécuté juste avant la suppression du paquet |TODO|
|
|
||||||
|postRemove |Exécuté juste après la suppression du paquet |TODO|
|
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
GPLv3
|
GPLv3
|
||||||
|
|
|
@ -61,15 +61,10 @@ do
|
||||||
|
|
||||||
# Define project_version opt if not defined
|
# Define project_version opt if not defined
|
||||||
if [ -z "$(get_opt project_version)" ]; then
|
if [ -z "$(get_opt project_version)" ]; then
|
||||||
# Share computed package version
|
# Share computed project version
|
||||||
set_opt project_version "${version}"
|
set_opt project_version "${version}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Native packages should not have a revision number
|
|
||||||
if [ $(get_opt package_format) == 'native' ]; then
|
|
||||||
package_version=$(echo ${version} | grep -oE '^[0-9.]+')
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${project_name} (${package_version}) ${distribution}; urgency=${urgency}" >> debian/changelog
|
echo "${project_name} (${package_version}) ${distribution}; urgency=${urgency}" >> debian/changelog
|
||||||
|
|
||||||
echo >> debian/changelog
|
echo >> debian/changelog
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source "${TAMARIN_UTIL}"
|
|
||||||
|
|
||||||
if [ -f "debian/source/format" ]; then
|
|
||||||
format=$(cat debian/source/format)
|
|
||||||
case ${format} in
|
|
||||||
"3.0 (native)")
|
|
||||||
set_opt package_format "native"
|
|
||||||
;;
|
|
||||||
"3.0 (quilt)")
|
|
||||||
set_opt package_format "quilt"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source "${TAMARIN_UTIL}"
|
|
||||||
|
|
||||||
project_name=$(get_opt project_name)
|
|
||||||
project_version=$(get_opt project_version)
|
|
||||||
|
|
||||||
src_tarball="../${project_name}_${project_version}.orig.tar.gz"
|
|
||||||
|
|
||||||
info "Creating sources tarball ${src_tarball}"
|
|
||||||
|
|
||||||
tar -czf "${src_tarball}" .
|
|
|
@ -34,7 +34,7 @@ function build_project()
|
||||||
|
|
||||||
cd "${workspace}"
|
cd "${workspace}"
|
||||||
|
|
||||||
dpkg-buildpackage -us -uc 2> >(error) 1> >(info)
|
dpkg-buildpackage -b 2> >(error) 1> >(info)
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
fatal "The build process has not completed successfuly !"
|
fatal "The build process has not completed successfuly !"
|
||||||
|
|
Loading…
Reference in New Issue