diff options
author | Arnstein Ressem <aressem@yahooinc.com> | 2023-11-08 13:49:32 +0100 |
---|---|---|
committer | Arnstein Ressem <aressem@yahooinc.com> | 2023-11-08 13:49:32 +0100 |
commit | 1501ccb9efa3a5506cbd38f5f486db0d42bc25f8 (patch) | |
tree | 43e2fab9a16ba3da98697bb8c39ba25c81a5da14 /screwdriver | |
parent | 9f41363b07c2cee35e3ca0442217f40d38cb81b8 (diff) |
Fix issues with sync and cleanup of archive artifacts.
Diffstat (limited to 'screwdriver')
-rwxr-xr-x | screwdriver/delete-old-cloudsmith-artifacts.sh | 3 | ||||
-rwxr-xr-x | screwdriver/publish-unpublished-rpms-to-archive.sh | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/screwdriver/delete-old-cloudsmith-artifacts.sh b/screwdriver/delete-old-cloudsmith-artifacts.sh index 1333aa6cec1..9e345646c13 100755 --- a/screwdriver/delete-old-cloudsmith-artifacts.sh +++ b/screwdriver/delete-old-cloudsmith-artifacts.sh @@ -10,7 +10,8 @@ curl -1sLf 'https://dl.cloudsmith.io/public/vespa/open-source-rpms/config.rpm.tx dnf config-manager --add-repo '/tmp/vespa-open-source-rpms.repo' rm -f /tmp/vespa-open-source-rpms.repo -VERSIONS_TO_DELETE=$(dnf list -y --quiet --showduplicates --disablerepo='*' --enablerepo=vespa-open-source-rpms vespa | awk '/[0-9].*\.[0-9].*\.[0-9].*/{print $2}' | sort -V | head -n -$MAX_NUMBER_OF_RELEASES | grep -v "7.594.36") +# Allow the last Vespa 7 release to remain in the repo +VERSIONS_TO_DELETE=$(dnf list -y --quiet --showduplicates --disablerepo='*' --enablerepo=vespa-open-source-rpms vespa | awk '/[0-9].*\.[0-9].*\.[0-9].*/{print $2}' | sort -V | grep -v "7.594.36" | head -n -$MAX_NUMBER_OF_RELEASES) if [[ -z "$VERSIONS_TO_DELETE" ]]; then echo "No old RPM versions to delete found. Exiting." diff --git a/screwdriver/publish-unpublished-rpms-to-archive.sh b/screwdriver/publish-unpublished-rpms-to-archive.sh index 9804fc5eeec..32e1b07d3db 100755 --- a/screwdriver/publish-unpublished-rpms-to-archive.sh +++ b/screwdriver/publish-unpublished-rpms-to-archive.sh @@ -38,7 +38,7 @@ cd $DLDIR readonly DNF="dnf -y -q --forcearch $RPMARCH" -$DNF list --disablerepo='*' --enablerepo=copr:copr.fedorainfracloud.org:group_vespa:vespa --showduplicates 'vespa*' | grep "Available Packages" -A 100000 | tail -n +2 | sed '/\.src\ */d' | sed "s/\.$RPMARCH\ */-/" | awk '{print $1}' | grep -v '.src$' > $COPR_PACKAGES +$DNF list --disablerepo='*' --enablerepo=copr:copr.fedorainfracloud.org:group_vespa:vespa --showduplicates 'vespa*' | grep "Available Packages" -A 100000 | tail -n +2 | sed '/\.src\ */d' | sed -E "s/\.($RPMARCH|noarch)\ */-/" | awk '{print $1}' | grep -v '.src$' > $COPR_PACKAGES echo "Packages on Copr:" cat $COPR_PACKAGES @@ -46,9 +46,12 @@ echo for pv in $(cat $COPR_PACKAGES); do if ! $DNF list --disablerepo='*' --enablerepo=vespa-open-source-rpms $pv &> /dev/null; then - echo "$pv not found on in archive. Downloading..." - $DNF download --disablerepo='*' --enablerepo=copr:copr.fedorainfracloud.org:group_vespa:vespa $pv - echo "$pv downloaded." + # Need one extra check here for noarch packages + if ! dnf -y -q --forcearch noarch list --disablerepo='*' --enablerepo=vespa-open-source-rpms $pv &> /dev/null; then + echo "$pv not found on in archive. Downloading..." + $DNF download --disablerepo='*' --enablerepo=copr:copr.fedorainfracloud.org:group_vespa:vespa $pv + echo "$pv downloaded." + fi fi done echo |