From 5c533e899b07a938eb85090f1a299ddc4b5e9128 Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Tue, 7 Jul 2015 11:29:26 +0900 Subject: [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 --- jjb/doctor/docu-build.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'jjb') 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 -- cgit 1.2.3-korg