From 030b7a53f3813d6f0556c6a19c1f041ac9515c23 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 24 Jul 2013 18:59:39 +0200 Subject: [PATCH] cleanup maven repo before build. set BUILD_NUMBER in version correctly --- maven_post_build_debian_wrapper.sh | 3 +-- maven_pre_build_debian_wrapper.sh | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/maven_post_build_debian_wrapper.sh b/maven_post_build_debian_wrapper.sh index 18be926..869a5f0 100755 --- a/maven_post_build_debian_wrapper.sh +++ b/maven_post_build_debian_wrapper.sh @@ -61,7 +61,7 @@ function validateInput # remove -SNAPSHOT VERSION=$(echo $VERSION | sed -s "s#-SNAPSHOT##g") BUILD_START=$(date +%Y%m%d%H%M%S) - VERSION="${VERSION}~${APPEND_TO_VERSION}${BUILD_START}+{BUILD_NUMBER}+g${GIT_COMMIT:0:7}" + VERSION="${VERSION}~${APPEND_TO_VERSION}${BUILD_START}+${BUILD_NUMBER}+g${GIT_COMMIT:0:7}" echo "==================================" echo $VERSION echo "==================================" @@ -120,6 +120,5 @@ if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then fi fi - #TODO: remove this debug output export diff --git a/maven_pre_build_debian_wrapper.sh b/maven_pre_build_debian_wrapper.sh index e4aaab9..086c051 100755 --- a/maven_pre_build_debian_wrapper.sh +++ b/maven_pre_build_debian_wrapper.sh @@ -1,7 +1,14 @@ #!/bin/bash +#TODO: remove this debug output +export + set -e +cd $WORKSPACE +# remove old maven repository if exists +[ -d .repository ] && rm .repository -rf +# clean up git git reset --hard if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then -- 2.39.5