Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ jobs:
./scripts/build_restic_backup.sh
./scripts/build_rsync_manager.sh
./scripts/build_health_monitor.sh
./scripts/build_kvm_snapshot_manager.sh

- name: Verify all builds
run: |
echo "Checking built executables..."
ls -lh dist/
for exe in notifier check_mails db_backup encrypted_mail restic_backup rsync_manager health_monitor; do
for exe in notifier check_mails db_backup encrypted_mail restic_backup rsync_manager health_monitor kvm_snapshot_manager; do
if [ ! -f "dist/$exe" ]; then
echo "❌ Missing executable: dist/$exe"
exit 1
Expand Down Expand Up @@ -118,6 +119,7 @@ jobs:
- `restic_backup` - Restic backup utility
- `rsync_manager` - Rsync management utility
- `health_monitor` - Health monitoring utility
- `kvm_snapshot_manager` - KVM snapshot management utility

### Installation
Download the executable you need and make it executable:
Expand All @@ -132,5 +134,6 @@ jobs:
dist/restic_backup
dist/rsync_manager
dist/health_monitor
dist/kvm_snapshot_manager
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "opsbox"
version = "0.2.1"
version = "0.3.1"
description = "A comprehensive Python library for server operations including backup scripts, encrypted mail functionality, and utility tools"
readme = "README.md"
license = {text = "MIT"}
Expand Down
55 changes: 55 additions & 0 deletions scripts/build_kvm_snapshot_manager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

# Build script for kvm_snapshot_manager executable using PyInstaller

set -e

echo "Building kvm_snapshot_manager executable..."

# Check if we're in the right directory
if [ ! -f "pyproject.toml" ]; then
echo "Error: Please run this script from the project root directory"
exit 1
fi

# Clean previous builds
echo "Cleaning previous builds..."
rm -rf build/ dist/kvm_snapshot_manager __pycache__/ *.spec

# Build the executable
echo "Building executable with PyInstaller..."
uv run pyinstaller --onefile \
--name kvm_snapshot_manager \
--hidden-import opsbox.logging \
--hidden-import opsbox.logging.logger_setup \
--hidden-import opsbox.logging.LoggingConfig \
--hidden-import opsbox.exceptions \
--hidden-import opsbox.encrypted_mail \
--hidden-import opsbox.locking \
--hidden-import opsbox.locking.lock_manager \
--hidden-import envelope \
--exclude-module opsbox.backup \
--exclude-module opsbox.db_snapshot \
--exclude-module opsbox.rsync \
--exclude-module opsbox.utils \
--strip \
--upx-dir=/usr/bin \
src/opsbox/KVMSnapshotManager/kvm_snapshot_manager.py

# Check if build was successful
if [ -f "dist/kvm_snapshot_manager" ]; then
echo "✅ Build successful!"
echo "📦 Executable created: dist/kvm_snapshot_manager"
echo "📏 File size: $(du -h dist/kvm_snapshot_manager | cut -f1)"

# Make executable
chmod +x dist/kvm_snapshot_manager

echo ""
echo "🚀 You can now run: ./dist/kvm_snapshot_manager --help"
echo "📋 Example usage: ./dist/kvm_snapshot_manager --domain <name> --base-image /path/to/base.qcow2 --remove-count 1"
rm -rf build/ *.spec
else
echo "❌ Build failed!"
exit 1
fi
1 change: 1 addition & 0 deletions src/opsbox/KVMSnapshotManager/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""KVM snapshot manager package."""
Loading