2022-01-18 21:05:02 +08:00
|
|
|
#!/bin/sh
|
2023-03-01 23:10:53 +08:00
|
|
|
# Usage: $0 [branch] [configure options]
|
2024-06-13 10:05:14 +08:00
|
|
|
# Create source tarball from HEAD or given branch and build it in openSUSE Leap 15.6 CI
|
2023-03-01 23:10:53 +08:00
|
|
|
# environment. Configure options follow branch name that can be empty.
|
2022-01-18 21:05:02 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-06-13 10:05:14 +08:00
|
|
|
CIIMAGEDIR=ci/images/ci-openSUSE-Leap-15.6-x86_64
|
2022-01-18 21:05:02 +08:00
|
|
|
BRANCH=${1:-HEAD}
|
2023-04-13 00:24:10 +08:00
|
|
|
if [ "$#" -ge 1 ]; then
|
|
|
|
shift
|
|
|
|
fi
|
2022-01-18 21:05:02 +08:00
|
|
|
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
|
2024-01-26 13:00:23 +08:00
|
|
|
./docker-run -- ./test-build devel --disable-documentation --disable-zoned "$@"
|