2017-03-06 02:25:19 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Build and test Git in a 32-bit environment
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# run-linux32-build.sh [host-user-id]
|
|
|
|
#
|
|
|
|
|
2018-01-30 01:17:10 +08:00
|
|
|
set -ex
|
2017-12-28 00:36:00 +08:00
|
|
|
|
2017-03-06 02:25:19 +08:00
|
|
|
# Update packages to the latest available versions
|
|
|
|
linux32 --32bit i386 sh -c '
|
|
|
|
apt update >/dev/null &&
|
|
|
|
apt install -y build-essential libcurl4-openssl-dev libssl-dev \
|
|
|
|
libexpat-dev gettext python >/dev/null
|
2018-01-30 01:17:10 +08:00
|
|
|
'
|
2017-03-06 02:25:19 +08:00
|
|
|
|
|
|
|
# If this script runs inside a docker container, then all commands are
|
|
|
|
# usually executed as root. Consequently, the host user might not be
|
|
|
|
# able to access the test output files.
|
|
|
|
# If a host user id is given, then create a user "ci" with the host user
|
|
|
|
# id to make everything accessible to the host user.
|
2018-01-30 01:17:10 +08:00
|
|
|
HOST_UID=$1
|
|
|
|
CI_USER=$USER
|
|
|
|
test -z $HOST_UID || (CI_USER="ci" && useradd -u $HOST_UID $CI_USER)
|
2017-03-06 02:25:19 +08:00
|
|
|
|
|
|
|
# Build and test
|
|
|
|
linux32 --32bit i386 su -m -l $CI_USER -c '
|
2018-01-30 01:17:10 +08:00
|
|
|
set -ex
|
|
|
|
cd /usr/src/git
|
2018-01-30 01:17:11 +08:00
|
|
|
test -n "$cache_dir" && ln -s "$cache_dir/.prove" t/.prove
|
2018-01-30 01:17:10 +08:00
|
|
|
make --jobs=2
|
|
|
|
make --quiet test
|
2017-03-06 02:25:19 +08:00
|
|
|
'
|