X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Fretention_script.sh;h=b2177930b646c09bc519510f4bbafff7e98fb6ca;hb=4bf5f31702c7e499755e56efe90a18c9b9828461;hp=9a8986ca54f0e605061457733499b4f412d6a50d;hpb=ee93f8d5acac795fa04c66df1460b21d039ad1ed;p=releng.git diff --git a/utils/retention_script.sh b/utils/retention_script.sh old mode 100644 new mode 100755 index 9a8986ca5..b2177930b --- a/utils/retention_script.sh +++ b/utils/retention_script.sh @@ -15,11 +15,14 @@ # limitations under the License. ############################################################################## +PATH=$PATH:/usr/local/bin/ + #These are the only projects that generate artifacts for x in armband ovsnfv fuel apex compass4nfv do echo "Looking at artifacts for project $x" + echo "In path gs://artifacts.opnfv.org/$x" while IFS= read -r artifact; do @@ -28,9 +31,10 @@ do daysold=$(($age/86400)) if [[ "$daysold" -gt "10" ]]; then - echo "$daysold Days old Deleting: $(basename $artifact)" + echo "$daysold Days old deleting: $(basename $artifact)" + gsutil rm "$artifact" else - echo "$daysold Days old Retaining: $(basename $artifact)" + echo "$daysold Days old retaining: $(basename $artifact)" fi done < <(gsutil ls gs://artifacts.opnfv.org/"$x" |grep -v "/$")