Drop repository for unsupported Releases

This commit is contained in:
Igor Pecovnik
2024-03-01 17:33:06 +01:00
committed by Igor
parent 7b61b05867
commit 2da50b4172

View File

@@ -1,5 +1,30 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Drop Unsupported Releases
#
drop_unsupported_releases() {
BUILD_FW=($(grep -rw config/distributions/*/support -ve 'eos' | cut -d"/" -f3))
REPO=($(aptly publish list -config="${CONFIG}" --raw | sed "s/. //g"))
DROP=()
for i in "${REPO[@]}"; do
skip=
for j in "${BUILD_FW[@]}"; do
[[ $i == $j ]] && { skip=1; break ; }
done
[[ -n $skip ]] || DROP+=("$i")
done
# drop
for i in "${DROP[@]}"; do
aptly publish drop -config="${CONFIG}" "${i}"
done
}
# Adding package # Adding package
# #
# @arg $1 string component # @arg $1 string component
@@ -259,6 +284,8 @@ case $3 in
;; ;;
update) update)
# remove old releases from publishing
drop_unsupported_releases
publishing "$1" "$2" "$3" "$4" "$5" publishing "$1" "$2" "$3" "$4" "$5"
;; ;;