Optimize the build process
This commit is contained in:
parent
66e6610ed2
commit
df00611edf
4
build.sh
4
build.sh
@ -52,17 +52,19 @@ dockerbuild(){
|
||||
if [ -n "$BUILDERNAME" ];then
|
||||
docker run -it -e DEB_BUILD_OPTIONS=$DEB_OPT -e PKGDIR=$SH_PATH/packages/$PKGNAME/$PKGNAME -v $SH_PATH/:$SH_PATH --name $PKGNAME --rm $BUILDERNAME || errlog "builderror"
|
||||
else
|
||||
docker run -it -e DEB_BUILD_OPTIONS=$DEB_OPT -e PKGDIR=$SH_PATH/packages/$PKGNAME/$PKGNAME -v $SH_PATH/:$SH_PATH --name $PKGNAME --rm pvebuilder || errlog "builderror"
|
||||
docker run -it -e DEB_BUILD_OPTIONS=$DEB_OPT -e PKGDIR=$SH_PATH/packages/$PKGNAME/$PKGNAME -v $SH_PATH/:$SH_PATH --name $PKGNAME --rm pvebuilder|| errlog "builderror"
|
||||
fi
|
||||
}
|
||||
|
||||
upload_pkg(){
|
||||
rm $PKG_LOCATION_PATH/$PKGNAME -rf
|
||||
mkdir $PKG_LOCATION_PATH/$PKGNAME -p
|
||||
find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.deb" -exec cp {} $PKG_LOCATION_PATH/$PKGNAME \;
|
||||
find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.buildinfo" -exec cp {} $PKG_LOCATION_PATH/$PKGNAME \;
|
||||
find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.changes" -exec cp {} $PKG_LOCATION_PATH/$PKGNAME \;
|
||||
find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.dsc" -exec cp {} $PKG_LOCATION_PATH/$PKGNAME \;
|
||||
find "$SH_PATH/packages/$PKGNAME/$PKGNAME" -name "*.tar*" -exec cp {} $PKG_LOCATION_PATH/$PKGNAME \;
|
||||
ls $PKG_LOCATION_PATH/$PKGNAME/
|
||||
for i in `ls $PKG_LOCATION_PATH/$PKGNAME/*.deb`;
|
||||
do
|
||||
md5sum $i > $i.md5
|
||||
|
||||
@ -15,21 +15,21 @@ exec_build(){
|
||||
echo "install depends"
|
||||
apt update
|
||||
yes |mk-build-deps --install --remove
|
||||
mkdir /tmp/$PKGDIR -p
|
||||
if [ -f "Makefile" ];then
|
||||
echo "clean "
|
||||
make clean || echo ok
|
||||
echo "build deb in `pwd` "
|
||||
if [ $dscflag == "dsc" ];then
|
||||
make dsc || errlog "build dsc error"
|
||||
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
|
||||
cp *.dsc *.tar.* /tmp/$PKGDIR
|
||||
fi
|
||||
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
|
||||
make deb || errlog "build deb error"
|
||||
# We need copy deb files first beacuse of deb will be clean when dsc build
|
||||
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
|
||||
# We need copy deb files first beacuse of deb will be clean when dsc build
|
||||
cp -r /tmp/$PKGDIR/* ./
|
||||
else
|
||||
dpkg-buildpackage -b -us -uc ||errlog "build deb error"
|
||||
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
|
||||
mv ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
|
||||
fi
|
||||
}
|
||||
|
||||
@ -42,16 +42,7 @@ if [ -f "$PKGDIR/../autobuild.sh" ];then
|
||||
cd $PKGDIR/../
|
||||
bash autobuild.sh
|
||||
else
|
||||
# Rust not need copy
|
||||
if [ ! -f "Cargo.toml" ];then
|
||||
cd $PKGDIR
|
||||
exec_build
|
||||
else
|
||||
mkdir /build/
|
||||
rsync -ra $PKGDIR /build
|
||||
cd /build/data
|
||||
exec_build
|
||||
fi
|
||||
|
||||
cd $PKGDIR
|
||||
exec_build
|
||||
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user