summaryrefslogtreecommitdiffstats
path: root/ci/build.sh
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-03-06 18:48:31 +0530
committerNavya Bathula <navyax.bathula@intel.com>2017-03-10 17:53:01 +0000
commit878d38941df56e0392cb652efe3c5996592e7f39 (patch)
treed7f76a991fa0ef1942172feeb03b2384bd8e9ec6 /ci/build.sh
parent77e6660ea78c5934e4b606a5342c4e0e64be1de6 (diff)
This patch includes building of the kernel rpm's for the commit id
provided in apex.conf file and renaming of the kernel rpm's in the format kvmfornfv-commitid-apex-kernel-[devel/header]-4.4.6_rt14_centos.x86_64.rpm Change-Id: Id36eec6a577ac92b436a68f975fc1293c04ab97d Co-Authored by: Navya Bathula <navyax.bathula@intel.com> Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'ci/build.sh')
-rwxr-xr-xci/build.sh49
1 files changed, 45 insertions, 4 deletions
diff --git a/ci/build.sh b/ci/build.sh
index 918e3cab7..ef06a716c 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -3,6 +3,25 @@
# Common parameter parsing for kvmfornfv scripts
#
+function checking_apex_build() {
+ echo ""
+ commit=`git rev-parse HEAD`
+ echo "commit id: $commit"
+ echo "Checking for presence of apex.conf in the current patch"
+ git diff-tree --no-commit-id --name-only -r ${commit} | grep apex.conf
+# result=`git show --name-only ${commit} | grep apex.conf`
+ result=`git diff-tree --no-commit-id --name-only -r ${commit} | grep apex.conf`
+ if [ -z "${result}" ]; then
+ echo "Does not include the file apex.conf"
+ apex_build_flag=0
+ else
+ source $WORKSPACE/ci/apex.conf
+ echo "Includes apex.conf"
+ apex_build_flag=1
+ fi
+}
+
+
function usage() {
echo ""
echo "Usage --> $0 [-p package_type] [-o output_dir] [-h]"
@@ -18,10 +37,18 @@ type=""
function run() {
case $1 in
centos)
- cd $WORKSPACE/ci/build_rpm
- sudo docker build -t kvm_rpm .
- sudo docker run --privileged=true -v $WORKSPACE:/opt/kvmfornfv -t kvm_rpm \
- /opt/kvmfornfv/ci/build_interface.sh $1
+ if [ ${apex_build_flag} -eq 0 ];then
+ cd $WORKSPACE/ci/build_rpm
+ sudo docker build -t kvm_rpm .
+ sudo docker run --privileged=true -v $WORKSPACE:/opt/kvmfornfv -t kvm_rpm \
+ /opt/kvmfornfv/ci/build_interface.sh $1
+ else
+ cd $WORKSPACE/ci/
+ echo $output_dir
+ sudo docker build -t kvm_apex .
+ sudo docker run --privileged=true -v $WORKSPACE:/opt/kvmfornfv -t kvm_apex \
+ /opt/kvmfornfv/ci/apex_build.sh build_output
+ fi
;;
ubuntu)
cd $WORKSPACE/ci/build_deb
@@ -96,5 +123,19 @@ echo ""
echo "Building for $type package in $output_dir"
echo ""
+checking_apex_build
mkdir -p $output_dir
build_package $type
+
+# Renaming the rpms in the format kvmfornfv-xxxxxxxx-apex-kernel-4.4.6_rt14.el7.centos.x86_64.rpm
+if [ ${apex_build_flag} -eq 1 ];then
+ cd ${output_dir}
+ echo "Renaming the rpms"
+ source $WORKSPACE/ci/apex.conf
+ echo "${commit_id}"
+ short_hash=`git rev-parse --short=8 ${commit_id}`
+ echo "$short_hash"
+ rename 's/^/kvmfornfv-'${short_hash}'-apex-/' kernel-*
+ variable=`ls kvmfornfv-* | grep "devel" | awk -F "_" '{print $3}' | awk -F "." '{print $1}'`
+ rename "s/${variable}/centos/" kvmfornfv-*
+fi