Apex: Fix CSIT snapshot files path
[releng.git] / utils / retention_script.sh
old mode 100644 (file)
new mode 100755 (executable)
index 9a8986c..b217793
 # 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 "/$")