diff --git a/utils/push-deb-to-gitea.sh b/utils/push-deb-to-gitea.sh index aed0e6a..1ec08a8 100644 --- a/utils/push-deb-to-gitea.sh +++ b/utils/push-deb-to-gitea.sh @@ -4,6 +4,7 @@ USERNAME="cyteen" PASSWORD="mlpfinsonik" DISTRIBUTION="ceres" COMPONENT="main" +ARCH=$(dpkg --print-architecture) 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 @@ -21,7 +22,7 @@ curl \ ${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}" +echo "deb [arch=\${ARCH} 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://cyteen:mlpfinsonik@git2.ring-zero.co.uk/api/v1/packages/cyteen/ | jq '.[] | select(.type == "debian") | {type, name, version, html_url, created_at}' diff --git a/utils/push-deb-to-gitea2.sh b/utils/push-deb-to-gitea2.sh deleted file mode 100644 index ec67948..0000000 --- a/utils/push-deb-to-gitea2.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -set -x - -USERNAME="cyteen" -PASSWORD="mlpfinsonik" -DISTRIBUTION="ceres" -COMPONENT="main" - -# Extract the architecture from the filename -DEB_FILE="$1" -ARCHITECTURE="${DEB_FILE%.*}" # Remove the.deb extension to get the architecture - -# Validate the architecture -if [[ $ARCHITECTURE =~ ^(amd64|arm64)$ ]]; then - echo "Invalid architecture. Must be either amd64 or arm64." - exit 1 -fi - -# Construct the GITEA URL based on the architecture -GITEA_URL="https://git2.ring-zero.co.uk/api/packages/${USERNAME}/debian/pool/${DISTRIBUTION}/${COMPONENT}/upload/${ARCHITECTURE}" - -# 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://cyteen:mlpfinsonik@git2.ring-zero.co.uk/api/v1/packages/cyteen/ | jq '.[] | select(.type == "debian") | {type, name, version, html_url, created_at}'