From e64d8d8567c0f800241d0223f9c3a075cbb95abc Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 13 Apr 2017 08:55:28 -0400 Subject: [PATCH 1/2] Change to using the long commit ID instead of short commit ID to help automation testing scripts calculate more information. Sync'ed up the code between LINUX and UBUNTU builds so the variables are more similar --- build-ubunturepo | 16 ++++++++-------- buildcore.sh | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 49e46cf63..70f4bda55 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -177,7 +177,7 @@ then short_short_ver=`cat Version|cut -d. -f 1` build_time=`date` build_machine=`hostname` - commit_id=`git rev-parse --short HEAD` + commit_id=`git rev-parse HEAD` package_dir_name=debs$REL #TODO: define the core path and tarball name @@ -362,14 +362,14 @@ __EOF__ chmod 775 mklocalrepo.sh # - # Add a buildinfo file under xcat-core to track information about the build + # Add a buildinfo file into the tar.bz2 file to track information about the build # - buildinfo=$local_core_repo_path/buildinfo - echo "VERSION=$ver" > $buildinfo - echo "RELEASE=$xcat_release" >> $buildinfo - echo "BUILD_TIME=$build_time" >> $buildinfo - echo "BUILD_MACHINE=$build_machine" >> $buildinfo - echo "COMMIT_ID=$commit_id" >> $buildinfo + BUILDINFO=$local_core_repo_path/buildinfo + echo "VERSION=$ver" > $BUILDINFO + echo "RELEASE=$xcat_release" >> $BUILDINFO + echo "BUILD_TIME=$build_time" >> $BUILDINFO + echo "BUILD_MACHINE=$build_machine" >> $BUILDINFO + echo "COMMIT_ID=$commit_id" >> $BUILDINFO #create the xcat-core.list file diff --git a/buildcore.sh b/buildcore.sh index 77b44068b..8686203c3 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -188,7 +188,7 @@ function setversionvars { SHORTSHORTVER=`echo $VER|cut -d. -f 1` BUILD_TIME=`date` BUILD_MACHINE=`hostname` - COMMIT_ID=`git rev-parse --short HEAD` + COMMIT_ID=`git rev-parse HEAD` XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')" echo "$XCAT_RELEASE" >Release } @@ -541,7 +541,7 @@ else fi # -# Add a VERSION file into the tar.bz2 file to track information about the build +# Add a buildinfo file into the tar.bz2 file to track information about the build # BUILDINFO=$XCATCORE/buildinfo echo "VERSION=$VER" > $BUILDINFO From 3d7bd7bab3681a22e490a01c18ab62b6a18e469a Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 26 Apr 2017 13:19:47 -0400 Subject: [PATCH 2/2] Create a new variable to store the long commit ID incase there are scripts already consuming the short commit ID --- build-ubunturepo | 4 +++- buildcore.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 70f4bda55..6e01caab8 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -177,7 +177,8 @@ then short_short_ver=`cat Version|cut -d. -f 1` build_time=`date` build_machine=`hostname` - commit_id=`git rev-parse HEAD` + commit_id=`git rev-parse --short HEAD` + commit_id_long=`git rev-parse HEAD` package_dir_name=debs$REL #TODO: define the core path and tarball name @@ -370,6 +371,7 @@ __EOF__ echo "BUILD_TIME=$build_time" >> $BUILDINFO echo "BUILD_MACHINE=$build_machine" >> $BUILDINFO echo "COMMIT_ID=$commit_id" >> $BUILDINFO + echo "COMMIT_ID_LONG=$commit_id_long" >> $BUILDINFO #create the xcat-core.list file diff --git a/buildcore.sh b/buildcore.sh index 8686203c3..bab8ce3b0 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -188,7 +188,8 @@ function setversionvars { SHORTSHORTVER=`echo $VER|cut -d. -f 1` BUILD_TIME=`date` BUILD_MACHINE=`hostname` - COMMIT_ID=`git rev-parse HEAD` + COMMIT_ID=`git rev-parse --short HEAD` + COMMIT_ID_LONG=`git rev-parse HEAD` XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')" echo "$XCAT_RELEASE" >Release } @@ -549,6 +550,7 @@ echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO +echo "COMMIT_ID_LONG=$COMMIT_ID_LONG" >> $BUILDINFO echo "Creating $(dirname $DESTDIR)/$TARNAME ..." if [[ -e $TARNAME ]]; then