2022-01-18 12:59:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Usage: $0 [branch]
|
2023-02-16 18:36:09 +00:00
|
|
|
# Create source tarball from HEAD or given branch and build it in Centos 8 CI
|
2022-01-18 12:59:08 +00:00
|
|
|
# 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-centos-8-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 --disable-libudev --disable-zoned
|