File: docker-build-deb.sh

package info (click to toggle)
grml-debootstrap 0.124
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 460 kB
  • sloc: sh: 2,525; python: 165; makefile: 70; ansic: 49
file content (44 lines) | stat: -rwxr-xr-x 1,077 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Build a grml-debootstrap.deb.
# To be run inside docker, as this script assumes it can modify the running OS.

set -eu -o pipefail
set -x

if [ "${1:-}" != "--autobuild" ]; then
  echo "$0: Only intended for CI scenarios, will destroy source files and modify running OS." >&2
  exit 1
fi
BUILD_NUMBER="${2:-}"
if [ -z "$BUILD_NUMBER" ]; then
  echo "$0: missing build number in arguments" >&2
  exit 1
fi

apt-get update
apt-get install -qq -y --no-install-recommends build-essential devscripts equivs

SOURCEDIR=$PWD

cd /tmp
mk-build-deps -ir -t 'apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y' "$SOURCEDIR"/debian/control

dpkg-source -b "$SOURCEDIR"
dpkg-source -x ./*.dsc builddir
cd builddir

OLD_VERSION=$(dpkg-parsechangelog -SVersion)

cat > debian/changelog <<EOT
grml-debootstrap (${OLD_VERSION}+autobuild${BUILD_NUMBER}) UNRELEASED; urgency=medium

  * Automated Build

 -- Automated Build <builder@localhost>  $(date -R)
EOT

dpkg-buildpackage -b --no-sign

mv ../*deb "$SOURCEDIR"/