IOPaint/scripts/pack.sh

39 lines
756 B
Bash
Raw Normal View History

2022-10-02 08:25:53 +02:00
#!/bin/bash
2022-10-24 12:32:35 +02:00
# Prepare basic python environment
2022-10-02 08:25:53 +02:00
set -e
2022-10-24 12:32:35 +02:00
# Ensuer not use user's python package
2022-10-02 08:25:53 +02:00
export PYTHONNOUSERSITE=1
BUILD_DIST=lama-cleaner
BUILD_ENV=installer
2022-10-24 12:32:35 +02:00
USER_SCRIPTS=user_scripts
2022-10-02 08:25:53 +02:00
echo "Creating a distributable package.."
source ~/miniconda3/etc/profile.d/conda.sh
conda install -c conda-forge -y conda-pack
conda env create --prefix $BUILD_ENV -f environment.yaml
conda activate ./$BUILD_ENV
conda pack --n-threads -1 --prefix $BUILD_ENV --format tar
mkdir -p ${BUILD_DIST}/$BUILD_ENV
2022-10-24 12:32:35 +02:00
echo "Copy user scripts file ${USER_SCRIPTS}"
cp ${USER_SCRIPTS}/* $BUILD_DIST
2022-10-02 08:25:53 +02:00
cd $BUILD_DIST
tar -xf ../${BUILD_ENV}.tar -C $BUILD_ENV
cd ..
rm -rf $BUILD_ENV
rm ${BUILD_ENV}.tar
2022-10-24 12:32:35 +02:00
echo "zip ${BUILD_DIST}.zip"
zip -q -r $BUILD_DIST.zip $BUILD_DIST
2022-10-02 08:25:53 +02:00