diff options
author | kalyanreddy <reddyx.gundarapu@intel.com> | 2017-07-18 18:14:39 +0530 |
---|---|---|
committer | kalyanreddy <reddyx.gundarapu@intel.com> | 2017-07-18 18:27:32 +0530 |
commit | 4525b15e86b4c7e2d426988c4ec1a11132a9f51b (patch) | |
tree | 35d391b78bdcd1d72c4b50640a4ab842a951c7da /ci/build.sh | |
parent | 465249b61b72d33fe1fad8d43da332faef22bec0 (diff) |
Generating only kernel debian packages
This patch includes scripts to generate only kernel debian packages
based on the commit-id provided in the compass conf file and also
used to remove code duplications.
NOTE: For generating the kernel debian packages commit-id should be
provided in compass.conf file and the default type should be changed
to 'ubuntu' in build.sh script.
Change-Id: I7f0822c565100a44e5289d6af825289e697130aa
Signed-off-by: Gundarapu Kalyan Reddy <reddyx.gundarapu@intel.com>
Diffstat (limited to 'ci/build.sh')
-rwxr-xr-x | ci/build.sh | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/ci/build.sh b/ci/build.sh index a52055940..441acc65d 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -21,6 +21,23 @@ function checking_apex_build() { fi } +function checking_compass_build() { + echo "" + commit=`git rev-parse HEAD` + echo "commit id: $commit" + echo "Checking for presence of compass.conf in the current patch" + git diff-tree --no-commit-id --name-only -r ${commit} | grep compass.conf + result=`git diff-tree --no-commit-id --name-only -r ${commit} | grep compass.conf` + if [ -z "${result}" ]; then + echo "Does not include the file compass.conf" + compass_build_flag=0 + else + source $WORKSPACE/ci/compass.conf + echo "Includes compass.conf" + compass_build_flag=1 + fi +} + function usage() { echo "" @@ -45,16 +62,26 @@ function run() { else cd $WORKSPACE/ci/ echo $output_dir + cp $WORKSPACE/ci/build_rpm/Dockerfile . 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 + /opt/kvmfornfv/ci/installer_build.sh build_output apex fi ;; ubuntu) - cd $WORKSPACE/ci/build_deb - sudo docker build -t kvm_deb . - sudo docker run -v $WORKSPACE:/opt/kvmfornfv -t kvm_deb \ - /opt/kvmfornfv/ci/build_interface.sh $1 + if [ ${compass_build_flag} -eq 0 ]; then + cd $WORKSPACE/ci/build_deb + sudo docker build -t kvm_deb . + sudo docker run -v $WORKSPACE:/opt/kvmfornfv -t kvm_deb \ + /opt/kvmfornfv/ci/build_interface.sh $1 + else + cd $WORKSPACE/ci/ + echo $output_dir + cp $WORKSPACE/ci/build_deb/Dockerfile . + sudo docker build -t kvm_docker . + sudo docker run --privileged=true -v $WORKSPACE:/opt/kvmfornfv -t kvm_docker \ + /opt/kvmfornfv/ci/installer_build.sh build_output compass + fi ;; *) echo "Not supported system"; exit 1;; esac @@ -125,6 +152,7 @@ echo "" echo "Building for $type package in $output_dir" echo "" +checking_compass_build checking_apex_build mkdir -p $output_dir build_package $type @@ -155,4 +183,4 @@ if [ $job_type == "verify" ]; then echo "Checking packages in output_dir" ls -lrth ${output_dir} fi -fi
\ No newline at end of file +fi |