Commit c142045f authored by Lisa's avatar Lisa

feat: add build.sh script to generate distribution packages

parent 6d826b53
#!/bin/bash
set -e
echo "=== Building Linux Distribution ==="
# Create dist directory
mkdir -p dist
# Create temporary build directory
BUILD_DIR=$(mktemp -d)
PACKAGE_DIR="$BUILD_DIR/hermes-node-agent"
mkdir -p "$PACKAGE_DIR"
echo "Copying files to $PACKAGE_DIR..."
# Copy core files
cp hermes_node_agent.py "$PACKAGE_DIR/"
cp browser_controller.py "$PACKAGE_DIR/"
cp requirements.txt "$PACKAGE_DIR/"
cp install.sh "$PACKAGE_DIR/"
cp install-on-sissy.sh "$PACKAGE_DIR/"
cp hermes-node-agent.init.d "$PACKAGE_DIR/"
cp hermes-node-agent.service "$PACKAGE_DIR/"
# Copy documentation
cp README.md "$PACKAGE_DIR/"
cp LICENSE "$PACKAGE_DIR/"
cp DEPLOYMENT.md "$PACKAGE_DIR/"
cp PROTOCOL.md "$PACKAGE_DIR/"
cp BROWSER_PROTOCOL.md "$PACKAGE_DIR/"
# Create tarball
cd "$BUILD_DIR"
tar czf hermes-node-agent-linux.tar.gz hermes-node-agent/
mv hermes-node-agent-linux.tar.gz "$OLDPWD/dist/"
cd "$OLDPWD"
# Cleanup
rm -rf "$BUILD_DIR"
echo "✅ Linux package created: dist/hermes-node-agent-linux.tar.gz"
echo ""
echo "To deploy:"
echo " scp dist/hermes-node-agent-linux.tar.gz user@node:~/"
echo " ssh user@node"
echo " tar xzf hermes-node-agent-linux.tar.gz"
echo " cd hermes-node-agent"
echo " sudo ./install.sh"
#!/bin/bash
set -e
echo "=== Building Windows Distribution ==="
# Check if running on Windows or if we can build Windows artifacts
if ! command -v python3 &> /dev/null; then
echo "ERROR: python3 not found"
exit 1
fi
# Create dist directory
mkdir -p dist
# Create temporary build directory
BUILD_DIR=$(mktemp -d)
PACKAGE_DIR="$BUILD_DIR/hermes-node-agent-windows"
mkdir -p "$PACKAGE_DIR"
echo "Copying files to $PACKAGE_DIR..."
# Copy core files
cp hermes_node_agent.py "$PACKAGE_DIR/"
cp browser_controller.py "$PACKAGE_DIR/"
cp requirements.txt "$PACKAGE_DIR/"
cp install-windows.ps1 "$PACKAGE_DIR/"
# Copy Windows-specific files
cp -r windows "$PACKAGE_DIR/"
# Copy documentation
cp README.md "$PACKAGE_DIR/"
cp LICENSE "$PACKAGE_DIR/"
cp WINDOWS_DEPLOYMENT.md "$PACKAGE_DIR/"
cp PROTOCOL.md "$PACKAGE_DIR/"
cp BROWSER_PROTOCOL.md "$PACKAGE_DIR/"
# Create zip archive
cd "$BUILD_DIR"
zip -r hermes-node-agent-windows.zip hermes-node-agent-windows/
mv hermes-node-agent-windows.zip "$OLDPWD/dist/"
cd "$OLDPWD"
# Cleanup
rm -rf "$BUILD_DIR"
echo "✅ Windows package created: dist/hermes-node-agent-windows.zip"
echo ""
echo "To build the Windows installer (.exe):"
echo " 1. Extract dist/hermes-node-agent-windows.zip on a Windows machine"
echo " 2. Install Python 3.8+ and Inno Setup"
echo " 3. Run: python windows\\build.py"
echo " 4. Installer will be in windows\\Output\\hermes-node-agent-installer.exe"
#!/bin/bash
set -e
echo "=== Building Hermes Node Agent ==="
# Build platform-specific artifacts
case "${1:-all}" in
linux|Linux)
echo "Building Linux artifacts..."
bash build-linux.sh
;;
windows|Windows)
echo "Building Windows artifacts..."
bash build-windows.sh
;;
all|ALL)
echo "Building all platform artifacts..."
bash build-linux.sh
bash build-windows.sh
;;
*)
echo "Usage: $0 [linux|windows|all]"
echo ""
echo "Builds the Node Agent distribution packages."
echo ""
echo " linux - Build Linux package"
echo " windows - Build Windows package"
echo " all - Build all packages (default)"
exit 1
;;
esac
echo ""
echo "✅ Build complete!"
echo ""
echo "Distribution packages:"
ls -1 dist/*.tar.gz dist/*.zip 2>/dev/null || echo " (none)"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment