diff options
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 |