From 0cd485cdfe79154db09989fd55724d459a885a32 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 24 Jan 2017 13:54:33 -0500 Subject: [PATCH] Create a buildinfo file for Ubuntu builds --- build-ubunturepo | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 36aa5d2d9..c53d18a53 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -183,6 +183,9 @@ then ver=`cat Version` short_ver=`cat Version|cut -d. -f 1,2` short_short_ver=`cat Version|cut -d. -f 1` + build_time=`date` + build_machine=`hostname` + commit_id=`git rev-parse --short HEAD` package_dir_name=debs$REL #TODO: define the core path and tarball name @@ -199,10 +202,9 @@ then #the package type: local | snap | alpha #the build introduce stirng - pkg_type="snap" build_string="Snap_Build" - cur_date=`date +%Y%m%d%H%M` - pkg_version="${ver}-${pkg_type}${cur_date}" + xcat_release="snap$(date '+%Y%m%d%H%M')" + pkg_version="${ver}-${xcat_release}" if [ ! -d ../../$package_dir_name ];then mkdir -p "../../$package_dir_name" @@ -369,6 +371,16 @@ __EOF__ chmod 775 mklocalrepo.sh + # + # Add a buildinfo file under xcat-core 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 + #create the xcat-core.list file cd ../