Need to have reviews under /$PROJECT/$review_number 91/9291/2
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 4 Feb 2016 19:48:26 +0000 (14:48 -0500)
committerAric Gardner <agardner@linuxfoundation.org>
Fri, 5 Feb 2016 16:01:40 +0000 (11:01 -0500)
If all the reviews are just review/$review_number
I dont have sufficent information to search reviews per project
this is needed for the new search tool

If this change is merged I will need to delete everything under /review/
this will lose current review artifacts, but allow future ones to be
searchable in the upcomming interface

Please comment if you can think of a better way to do this.
note: at some past point reviews were in their project folder.

Change-Id: I0778ca92a0a0922c6e5f2749edd0c9f6a2dcc591
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
jjb/releng-macros.yaml

index 5d95707..b43a76d 100644 (file)
             echo "###########################"
             echo
 
-            gs_base="artifacts.opnfv.org/review"
+            gs_base="artifacts.opnfv.org/$PROJECT/review"
             gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
             local_path="upload/$GERRIT_CHANGE_NUMBER"
 
 
             [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
 
+            gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
+
+            if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
+                echo
+                echo "Deleting Out-of-dated Documents..."
+                gsutil -m rm -r "gs://$gs_path"
+            fi
             gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
 
             if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then