Created
November 19, 2021 22:12
-
-
Save Vitexus/a232926785d9a031b58434abf5d05bc3 to your computer and use it in GitHub Desktop.
Deb Repository with aptly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TERM="xterm" | |
export TERM | |
BACKPORTS=" composer freight " | |
strstr() { | |
[ "${1#*$2*}" = "$1" ] && return 1 | |
return 0 | |
} | |
if [ -z "$(ls -A /var/tmp/deb/*.deb)" ]; then | |
echo "No packages to add in /var/tmp/deb" | |
curl -s -X POST ${BUILD_URL}stop --user vitex:token | |
exit 0 | |
fi | |
for PACKAGE in $(ls -t /var/tmp/deb/*.deb | tac) | |
do | |
DISTRO=`echo $PACKAGE | awk -F~ '{print $2}'` | |
DEB=`basename $PACKAGE | awk -F_ '{print $1}'` | |
if [[ $BACKPORTS =~ " $DEB " ]] | |
then | |
DISTRO=$DISTRO-backports | |
fi | |
aptly repo add $DISTRO $PACKAGE | |
rm -f $PACKAGE | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
aptly publish repo -architectures=amd64,all -component=main,backports buster buster-backports | |
aptly publish repo -architectures=amd64,all -component=main,backports bullseye bullseye-backports | |
aptly publish repo -architectures=amd64,all -component=main,backports focal focal-backports | |
aptly publish repo -architectures=amd64,all -component=main,backports hirsute hirsute-backports | |
aptly publish repo -architectures=amd64,all -component=main bookworm | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
aptly repo create -comment="Buster packages" -distribution="buster" buster | |
aptly repo create -comment="Focal packages" -distribution="focal" focal | |
aptly repo create -comment="Bullseye packages" -distribution="bullseye" bullseye | |
aptly repo create -comment="Hirstute packages" -distribution="hirsute" hirsute | |
aptly repo create -comment="Bookworm packages" -distribution="bookworm" bookworm | |
aptly repo create -comment="Buster backports packages" -distribution="buster" buster-backports | |
aptly repo create -comment="Focal backports packages" -distribution="focal" focal-backports | |
aptly repo create -comment="Bullseye backports packages" -distribution="bullseye" bullseye-backports | |
aptly repo create -comment="Hirsute backports packages" -distribution="hirsute" hirsute-backports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for i in $(aptly publish list -raw | awk '{print $2}'); do | |
echo "aptly publish drop $i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment