automate/gitea-scripts/push-deb-to-gitea.sh

28 lines
898 B
Bash
Executable File

#!/usr/bin/env bash
USERNAME="cyteen"
PASSWORD="mlpfinsonik"
DISTRIBUTION="ceres"
COMPONENT="main"
GITEA_URL="https://git2.ring-zero.co.uk/api/packages/${USERNAME}/debian/pool/${DISTRIBUTION}/${COMPONENT}/upload"
# Check if a .deb file was provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <deb_file>"
exit 1
fi
DEB_FILE="$1"
# Upload the specified .deb file
curl --user ${USERNAME}:${PASSWORD} \
--upload-file ./${DEB_FILE} \
${GITEA_URL}
echo "See: automate/020_gitea_dpr.sh for sources.list creation."
# echo "deb [signed-by=\${KEYRING}] https://${USERNAME}:${PASSWORD}@https://git2.ring-zero.co.uk/api/packages/${USERNAME}/debian ${DISTRIBUTION} ${COMPONENT}"
# Show available packages
curl -s --url https://${USERNAME}:${PASSWORD}@git2.ring-zero.co.uk/api/v1/packages/${USERNAME}/ \
jq '.[] | select(.type == "debian") | {type, name, version, html_url, created_at}'