deb-mock/scripts/upload-to-repo.sh
robojerk 16bfc027bf
Some checks failed
Build and Publish Debian Package / build-deb (push) Failing after 1m33s
Build Deb-Mock Package / build (push) Successful in 1m22s
Test Deb-Mock Build / test (push) Failing after 50s
add Debian packaging and repository infrastructure
2025-08-03 23:38:25 +00:00

47 lines
No EOL
1.1 KiB
Bash
Executable file

#!/bin/bash
set -e
# Upload script for Deb-Mock Debian Repository
# This script uploads built packages to the repository
REPO_DIR="/var/www/debian-repo"
PACKAGE_DIR="."
echo "Uploading Deb-Mock packages to repository..."
# Check if we're in the right directory
if [ ! -f "debian/control" ]; then
echo "Error: Not in deb-mock source directory"
exit 1
fi
# Build the package if not already built
if [ ! -f "../deb-mock_*.deb" ]; then
echo "Building Debian package..."
dpkg-buildpackage -us -uc -b
fi
# Find the built package
PACKAGE_FILE=$(ls ../deb-mock_*.deb | head -1)
if [ ! -f "$PACKAGE_FILE" ]; then
echo "Error: No deb-mock package found"
exit 1
fi
echo "Found package: $PACKAGE_FILE"
# Upload to repository
echo "Adding package to repository..."
sudo reprepro -b "$REPO_DIR" includedeb unstable "$PACKAGE_FILE"
# Update repository
echo "Updating repository..."
sudo reprepro -b "$REPO_DIR" export unstable
# List repository contents
echo "Repository contents:"
sudo reprepro -b "$REPO_DIR" list unstable
echo "Package uploaded successfully!"
echo "Repository URL: http://debian.raines.xyz"