Skip to content

Commit 947a6b5

Browse files
committed
chore(debian): add scripts to build debian package
Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
1 parent 06205e5 commit 947a6b5

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
exec docker run -it --rm --name python-ovh-debian-builder -v python-ovh-debian-builder-output:/output -v "${PWD}:/python-ovh:ro" debian:buster /python-ovh/scripts/build-debian-package-recipe.sh
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
set -e
3+
4+
mkdir -p /home/pkg/
5+
cp -r /python-ovh/ /home/pkg/src
6+
cd /home/pkg/src
7+
8+
export DEBIAN_FRONTEND="noninteractive"
9+
apt-get update
10+
# Add basic packages
11+
apt-get install -y ca-certificates apt-transport-https
12+
13+
# Build package tooling
14+
apt-get -yq install procps build-essential devscripts quilt debhelper
15+
apt-get -yq install dh-systemd
16+
17+
18+
DEBUILD_OPTIONS=--buildinfo-option=-O
19+
20+
mkdir -p /home/pkg/src/ovh
21+
if [ ! -f /home/pkg/src/ovh/bbb ] && [ ! -f /home/pkg/src/ovh/build ]; then
22+
echo "INFO: BuildBot is creating an executable file in ovh/bbb"
23+
mkdir -p /home/pkg/src/ovh
24+
cat > /home/pkg/src/ovh/bbb << EOF
25+
set -e
26+
debuild $DEBUILD_OPTIONS -us -uc -b -j$(nproc)
27+
EOF
28+
29+
cat /home/pkg/src/ovh/bbb
30+
chmod +x /home/pkg/src/ovh/bbb
31+
fi
32+
33+
echo "BUILDBOT> Prepare the build process with Debian build dependencies (if debian/control file exists)"
34+
if [ -f /home/pkg/src/debian/control ]; then
35+
mk-build-deps -r -t "apt-get --no-install-recommends -y" -i /home/pkg/src/debian/control
36+
else
37+
echo "INFO: /home/pkg/src/debian/control is absent...skipping mk-build-deps"
38+
fi
39+
if [ -f /home/pkg/src/ovh/bbb ]; then
40+
echo "BUILDBOT> Starting the build process via /home/pkg/src/ovh/bbb"
41+
cd /home/pkg/src && ./ovh/bbb
42+
elif [ -f /home/pkg/src/ovh/build ]; then
43+
echo "BUILDBOT> Starting the build process via /home/pkg/src/ovh/build"
44+
cd /home/pkg/src && ./ovh/build
45+
fi
46+
47+
echo "BUILDBOT> Moving output to the artifact directory"
48+
cd /home/pkg && find . -maxdepth 1 -type f -print -exec mv '{}' /output/ \;
49+
chown -R 1000:1000 /output/

0 commit comments

Comments
 (0)