From: Ryota MIBU Date: Tue, 7 Jul 2015 02:29:26 +0000 (+0900) Subject: [doctor] make sure jenkins deletes old files X-Git-Tag: arno.2015.2.0~166^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=5c533e899b07a938eb85090f1a299ddc4b5e9128;hp=-c;p=releng.git [doctor] make sure jenkins deletes old files Currently, jenkis will remove old built files under review/ only when "change-merged". This won't performed in "remerge" jobs. This patch make sure that jenkins deletes out-of-dated document files from the artifact server after it successfully uploaded latest documents to the server. JIRA: DOCTOR-12 Change-Id: I6891fec8559e75ad81d86258ade6d32a7bd0e368 Signed-off-by: Ryota MIBU --- 5c533e899b07a938eb85090f1a299ddc4b5e9128 diff --git a/jjb/doctor/docu-build.sh b/jjb/doctor/docu-build.sh index 61613453f..ffb131114 100644 --- a/jjb/doctor/docu-build.sh +++ b/jjb/doctor/docu-build.sh @@ -37,13 +37,11 @@ else gsutil cp -r build/requirements/html "gs://$gs_path_branch/" gsutil cp -r build/requirements/latex/*.pdf "gs://$gs_path_branch/" echo - echo "Document is available at http://$gs_path_branch" -fi + echo "Latest document is available at http://$gs_path_branch" -if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then - echo - echo "Clean Out-of-dated Documents" - echo "----------------------------" - echo - gsutil rm -r "gs://$gs_path_review" || true + if gsutil ls "gs://$gs_path_review" > /dev/null 2>&1 ; then + echo + echo "Deleting Out-of-dated Documents..." + gsutil rm -r "gs://$gs_path_review" + fi fi