btrfs-progs/ci/ci-build-musl
David Sterba 1907cd64db btrfs-progs: ci: add script to do build test on musl
Run ci/ci-build-musl to verify build of current branch works in
environment with musl libc. Also works for a given branch name.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-07-26 13:45:35 +02:00

32 lines
777 B
Bash
Executable File

#!/bin/sh
# Usage: $0 [branch]
# Create source tarball from HEAD or given branch and build it in musl CI
# environment
HERE=`pwd`
if [ -f "configure.ac" ]; then
SOURCEDIR=`pwd`
elif [ -f "../configure.ac" ]; then
cd ..
SOURCEDIR=`pwd`
else
echo "ERROR: cannot determine source directory from `pwd`"
exit 1
fi
CIIMAGEDIR=ci/images/ci-musl-x86_64
BRANCH=${1:-HEAD}
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"
git archive --prefix=btrfs-progs-devel/ -o devel.tar "$BRANCH"
echo "$BRANCH $HASH" > GITCOMMIT
tar uvf devel.tar GITCOMMIT
#rm GITCOMMIT
gzip --force --best devel.tar
cd "$CIIMAGEDIR"
cp "$SOURCEDIR/devel.tar.gz" .
./docker-build
./docker-run -- ./test-build devel --disable-documentation --disable-backtrace