Extraction automatique du nom de projet avant le packaging

This commit is contained in:
William Petit 2017-03-10 22:01:05 +01:00
parent 448a16f659
commit 1d566f8de8
3 changed files with 14 additions and 12 deletions

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
cd src
if [ -z "$(tamarin_db get project_name)" ]; then
if [ ! -d ".git" ]; then
tamarin_error "This project is not managed with Git ! Cannot extract the project's name without it !"
exit 1
fi
project_name=$(basename $(git config --get remote.origin.url) | sed 's/.git$//' | tr '[:upper:]' '[:lower:]')
tamarin_info "Extracted project name from Git metadata: \"${project_name}\""
tamarin_db set project_name "${project_name}"
fi

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "${DIR}/util.sh"
info "Updating packages definition..."
apt-get update 2> >(stderr) 1> >(stdout)
info "Installing package $1..."
gdebi --n "$1" 2> >(stderr) 1> >(stdout)

View File

@ -12,6 +12,7 @@ hooks=containerbuild/debian/install-build-essential,
[prebuild]
hooks=prebuild/debian/load-project-db,
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/complete-project-db,
prebuild/debian/create-changelog,
prebuild/debian/create-dummy-changelog,
prebuild/debian/add-package-version-suffix,