feature/integracion-cpanel-asrecovery
This commit is contained in:
43
build.sh
Executable file
43
build.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build CloudRestoreAS — PyInstaller onefile portable (Linux)
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")" && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
echo "==============================================="
|
||||
echo "CloudRestoreAS - Build Linux (onefile)"
|
||||
echo "==============================================="
|
||||
|
||||
bash "$ROOT/packaging/scripts/download-bundled-deps.sh"
|
||||
|
||||
VENV="$ROOT/venv-linux"
|
||||
if [[ ! -x "$VENV/bin/python" ]]; then
|
||||
rm -rf "$VENV"
|
||||
python3 -m venv "$VENV"
|
||||
fi
|
||||
"$VENV/bin/pip" install --upgrade pip -q
|
||||
"$VENV/bin/pip" install -r requirements.txt -q
|
||||
|
||||
BUILD_DIR="${CLOUDRESTORE_BUILD_DIR:-/tmp/cloudrestore-build}"
|
||||
DIST_DIR="${CLOUDRESTORE_DIST_DIR:-$ROOT/dist}"
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR" "$DIST_DIR"
|
||||
rm -f "$DIST_DIR/CloudRestoreAS"
|
||||
|
||||
echo "Ejecutando PyInstaller (onefile)..."
|
||||
"$VENV/bin/python" -m PyInstaller packaging/CloudRestoreAS.spec \
|
||||
--clean --noconfirm \
|
||||
--distpath "$DIST_DIR" \
|
||||
--workpath "$BUILD_DIR"
|
||||
|
||||
BIN="$ROOT/dist/CloudRestoreAS"
|
||||
if [[ -f "$BIN" ]]; then
|
||||
chmod +x "$BIN"
|
||||
echo ""
|
||||
echo "Build OK: $BIN"
|
||||
echo "Distribuir solo el binario; al ejecutar crea config/ automaticamente."
|
||||
else
|
||||
echo "Error: no se genero el binario" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user