Feat!: Upgrade Jenkins-job-builder to 6x
[ci-management.git] / jjb / deb_dpdk / include-raw-deb_dpdk-build.sh
1 #!/bin/bash
2
3 set -e -o pipefail
4
5 # print the current slave hostname
6 hostname
7
8 for hashfile in bootstrap.sha bootstrap-functions.sha
9 do
10     echo -n "${hashfile}: "
11     if [ -f /etc/${hashfile} ];then
12         cat /etc/${hashfile}
13     else
14         echo "Cannot find ${hashfile}"
15     fi
16 done
17
18 echo "sha1sum of script [${0}]: " $(sha1sum $0)
19
20 MISSING_PKGS=$(dpkg-checkbuilddeps |& perl -pe 's/^.+://g; s/\(.*?\)//g; s/\|\s+\S+//g;')
21 MISSING_PKGS="devscripts pristine-tar ${MISSING_PKGS}"
22
23 if [ -n "${MISSING_PKGS}" ]
24 then
25     echo "*******************************************************************"
26     echo "* ADD MISSING DEPENDENCIES TO RESPIN SCRIPT:"
27     echo "${MISSING_PKGS}"
28     echo "*******************************************************************"
29 fi
30
31 sudo apt-get update
32 sudo apt-get install -y ${MISSING_PKGS}
33
34 pkg_version=$(dpkg-parsechangelog --show-field Version)
35 orig_version=$(echo ${pkg_version} | perl -pe 's/-.+$//') # remove debian suffix
36 orig_tarball=$(git ls-tree remotes/origin/pristine-tar | perl -ne "print /(dpdk_${orig_version}.orig.+).id/")
37
38 pristine-tar checkout ${orig_tarball}
39 mv ${orig_tarball} ..
40
41 debuild -uc -us -j4
42
43 # No fail on lintian errors
44 set +e
45 lintian --info --no-tag-display-limit "dpdk_${pkg_version}_source.changes"
46
47 echo "*******************************************************************"
48 echo "* DEB_DPDK BUILD SUCCESSFULLY COMPLETED"
49 echo "*******************************************************************"