summaryrefslogtreecommitdiffstats
path: root/jjb/apex
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-06-03 16:15:36 -0400
committerTim Rozet <trozet@redhat.com>2016-06-03 16:25:48 -0400
commit7f99e22708f48a684d09f532a999f2b14e84a9c1 (patch)
treea179bfed473db83be5296d91c879bdda3d06d551 /jjb/apex
parent7e71071cd718f3bd360c7daf1608f47bf49c1f63 (diff)
Apex: Fixes build caching
Changes include: - Removing deprecated Brahmaputra support - Properly passing CACHE_DIRECTORY without file:// prefix JIRA: APEX-167 Change-Id: Ic52e394d682d59662006a74ec2d32eef7bc3b6c2 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'jjb/apex')
-rwxr-xr-xjjb/apex/apex-build.sh48
1 files changed, 22 insertions, 26 deletions
diff --git a/jjb/apex/apex-build.sh b/jjb/apex/apex-build.sh
index ca1821abf..f6b2e3214 100755
--- a/jjb/apex/apex-build.sh
+++ b/jjb/apex/apex-build.sh
@@ -10,41 +10,36 @@ echo
[[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
# set OPNFV_ARTIFACT_VERSION
if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
- if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
- export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
- export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
- else
- export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
- fi
+ export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
elif [ "$ARTIFACT_VERSION" == "daily" ]; then
- if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
- export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
- export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
- else
- export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
- fi
+ export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --iso"
else
export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
- if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
- export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
- else
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
- fi
-fi
-# clean for stable but doesn't matter for master
-if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
- sudo opnfv-clean
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --iso"
fi
+
# start the build
cd $WORKSPACE/ci
./build.sh $BUILD_ARGS
RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
# list the contents of BUILD_OUTPUT directory
+echo "Build Directory is ${BUILD_DIRECTORY}"
+echo "Build Directory Contents:"
+echo "-------------------------"
ls -al $BUILD_DIRECTORY
-# save information regarding artifact into file
-(
+
+# list the contents of CACHE directory
+echo "Cache Directory is ${CACHE_DIRECTORY}"
+echo "Cache Directory Contents:"
+echo "-------------------------"
+ls -al $CACHE_DIRECTORY
+
+if ! echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
+ echo "Writing opnfv.properties file"
+ # save information regarding artifact into file
+ (
echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
@@ -54,6 +49,7 @@ ls -al $BUILD_DIRECTORY
echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
echo "OPNFV_BUILD_URL=$BUILD_URL"
-) > $WORKSPACE/opnfv.properties
+ ) > $WORKSPACE/opnfv.properties
+fi
echo "--------------------------------------------------------"
echo "Done!"