aboutsummaryrefslogtreecommitdiffstats
path: root/screwdriver/delete-old-artifactory-artifacts.sh
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@yahooinc.com>2022-07-20 13:33:17 +0200
committerArnstein Ressem <aressem@yahooinc.com>2022-07-20 13:33:17 +0200
commita545a4c4507b865704a3447f2d3ee317cf65b41d (patch)
treec459addd561dadb9fa658480c1bf42e69a5e5c9f /screwdriver/delete-old-artifactory-artifacts.sh
parent46ba1b00aa19e937e2c257b34c23417adeef56eb (diff)
After switching to el8 / Vespa 8, we stopped cleaning the old Vespa 7 releases. Need to continue with this except the last 7 release to avoid filling the external public Artifactory instance.
Diffstat (limited to 'screwdriver/delete-old-artifactory-artifacts.sh')
-rwxr-xr-xscrewdriver/delete-old-artifactory-artifacts.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/screwdriver/delete-old-artifactory-artifacts.sh b/screwdriver/delete-old-artifactory-artifacts.sh
index 80cee37bd72..3bb968f3995 100755
--- a/screwdriver/delete-old-artifactory-artifacts.sh
+++ b/screwdriver/delete-old-artifactory-artifacts.sh
@@ -10,15 +10,20 @@ ARTIFACTORY_URL="https://artifactory.yahooinc.com/artifactory"
# JFrog Cloud repo file
if [[ ! -f /etc/yum.repos.d/vespa.repo ]]; then
cat << EOF > /etc/yum.repos.d/vespa.repo
-[vespa-release]
+[vespa-release-el8]
name=Vespa releases
baseurl=$ARTIFACTORY_URL/vespa/centos/8/release/\$basearch
gpgcheck=0
enabled=1
+[vespa-release-el7]
+name=Vespa releases
+baseurl=$ARTIFACTORY_URL/vespa/centos/7/release/\$basearch
+gpgcheck=0
+enabled=1
EOF
fi
-VERSIONS_TO_DELETE=$(dnf list --quiet --showduplicates --disablerepo='*' --enablerepo=vespa-release vespa | awk '/[0-9].*\.[0-9].*\.[0-9].*/{print $2}' | sort -V | head -n -200)
+VERSIONS_TO_DELETE=$(dnf list --quiet --showduplicates --disablerepo='*' --enablerepo=vespa-release-el7,vespa-release-el8 vespa | awk '/[0-9].*\.[0-9].*\.[0-9].*/{print $2}' | sort -V | head -n -200 | grep -v "7.594.36")
RPMS_TO_DELETE=$(mktemp)
trap "rm -f $RPMS_TO_DELETE" EXIT