From caac9056faa17b3ed0ad214b229ccc25b6a828e3 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 28 Mar 2017 14:08:29 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20hooks=20embarqu=C3=A9s=20dans=20u?= =?UTF-8?q?n=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/common/run-project-hooks | 14 ++++++++++++++ hooks/postbuild/debian/run-project-hooks | 4 ++++ hooks/prebuild/debian/run-project-hooks | 4 ++++ profiles/debian.conf | 11 ++++++++--- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100755 hooks/common/run-project-hooks create mode 100755 hooks/postbuild/debian/run-project-hooks create mode 100755 hooks/prebuild/debian/run-project-hooks diff --git a/hooks/common/run-project-hooks b/hooks/common/run-project-hooks new file mode 100755 index 0000000..dedb651 --- /dev/null +++ b/hooks/common/run-project-hooks @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +step=$1 +hook=src/.tamarin/$step + +if [ ! -f "$hook" ] || [ ! -x "$hook" ]; then + tamarin_info "No project hook (or not executable) for \"$step\"... Skipping." + exit +fi + +tamarin_info "Project hook found for \"$step\". Running it..." +"$hook" diff --git a/hooks/postbuild/debian/run-project-hooks b/hooks/postbuild/debian/run-project-hooks new file mode 100755 index 0000000..29476b8 --- /dev/null +++ b/hooks/postbuild/debian/run-project-hooks @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +$(readlink -f $DIR/../../common/run-project-hooks) postbuild diff --git a/hooks/prebuild/debian/run-project-hooks b/hooks/prebuild/debian/run-project-hooks new file mode 100755 index 0000000..5ee3894 --- /dev/null +++ b/hooks/prebuild/debian/run-project-hooks @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +$(readlink -f $DIR/../../common/run-project-hooks) prebuild diff --git a/profiles/debian.conf b/profiles/debian.conf index 3e45177..28b4586 100644 --- a/profiles/debian.conf +++ b/profiles/debian.conf @@ -5,13 +5,16 @@ default_image=debian:jessie # Configuration de l'étape de pré-construction du conteneur [containerbuild] -hooks=containerbuild/debian/install-build-essential, +hooks= + containerbuild/debian/install-build-essential, containerbuild/debian/install-git # Configuration de l'étape de pré-construction du paquet [prebuild] -hooks=prebuild/debian/load-project-db, +hooks= prebuild/debian/copy-sources-to-workspace, + prebuild/debian/run-project-hooks, + prebuild/debian/load-project-db, prebuild/debian/complete-project-db, prebuild/debian/create-changelog, prebuild/debian/create-dummy-changelog, @@ -24,4 +27,6 @@ hooks=build/debian/build # Configuration de l'étape de post-construction du paquet [postbuild] -hooks=postbuild/debian/export-dist +hooks= + postbuild/debian/run-project-hooks, + postbuild/debian/export-dist