47 lines
No EOL
1.1 KiB
Bash
Executable file
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" |