summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2015-07-07 11:29:26 +0900
committerRyota MIBU <r-mibu@cq.jp.nec.com>2015-07-07 11:40:14 +0900
commit5c533e899b07a938eb85090f1a299ddc4b5e9128 (patch)
tree82b8a8b9552278faa7a4e065c49fa8fbc14f7d31 /jjb
parent415804075ff3c9a2d6fa55899a0933d46de9bca4 (diff)
[doctor] make sure jenkins deletes old files
Currently, jenkis will remove old built files under review/<change-ID> 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 <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'jjb')
-rw-r--r--jjb/doctor/docu-build.sh14
1 files changed, 6 insertions, 8 deletions
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