• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# helper script to be invoked by jenkins/buildbot
4
5# $1 [optional]: the build type - release | nightly | test
6buildtype=${1:-test}
7
8set -x
9set -e
10
11PARALLEL=${PARALLEL:-1}
12TMP=$(mktemp -d /tmp/debuild.XXXXXX)
13
14function cleanup() {
15  [[ -d $TMP ]] && rm -rf $TMP
16}
17trap cleanup EXIT
18
19. scripts/git-tag.sh
20
21git archive HEAD --prefix=bcc/ --format=tar.gz -o $TMP/bcc_$revision.orig.tar.gz
22
23pushd $TMP
24tar xf bcc_$revision.orig.tar.gz
25cd bcc
26
27debuild=debuild
28if [[ "$buildtype" = "test" ]]; then
29  # when testing, use faster compression options
30  debuild+=" --preserve-envvar PATH"
31  echo -e '#!/bin/bash\nexec /usr/bin/dpkg-deb -z1 "$@"' \
32    | sudo tee /usr/local/bin/dpkg-deb
33  sudo chmod +x /usr/local/bin/dpkg-deb
34  dch -b -v $revision-$release "$git_subject"
35fi
36if [[ "$buildtype" = "nightly" ]]; then
37  dch -v $revision-$release "$git_subject"
38fi
39
40DEB_BUILD_OPTIONS="nocheck parallel=${PARALLEL}" $debuild -us -uc
41popd
42
43cp $TMP/*.deb .
44