Use shared directory for test data on Jenkins
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 23 Nov 2015 14:00:53 +0100
changeset 552 f79944e2bd85
parent 551 00ebb1b85f53
child 553 d83cb4945d5e
Use shared directory for test data on Jenkins ...in order to save bandwidth and disk space.
ci/ci-common.sh
--- a/ci/ci-common.sh	Mon Nov 23 11:14:30 2015 +0100
+++ b/ci/ci-common.sh	Mon Nov 23 14:00:53 2015 +0100
@@ -6,7 +6,24 @@
 if [ -z "$BUILD_NUMBER" ]; then
    BUILD_NUMBER=0
 fi
-PETITCOMPILER_DATA_DIRECTORY=test-data
+
+# Environment variable PETITCOMPILER_DATA_DIRECTORY
+# should point to the directory where test data are
+# stored (or where they should be downloaded and 
+# unpacked. To save bandwidth and disk space, when run
+# on (CTU FIT) Jenkins, point them to the shared directory
+
+case $(uname -n) in
+  swing-h-win64)
+    PETITCOMPILER_DATA_DIRECTORY="E:\\workspace\\petitcompiler_test_data"
+    ;;
+  swing-hudson-lin64)
+    PETITCOMPILER_DATA_DIRECTORY="/ws/workspace/petitcompiler_test_data"
+    ;;
+  *)
+    PETITCOMPILER_DATA_DIRECTORY=test-data
+    ;;
+esac 
 PETITCOMPILER_BENCHMARK_REPORT=benchmark-results-$BUILD_NUMBER.json
 
 function ci_download_and_unzip_file {
@@ -16,8 +33,8 @@
   local directory=${file%.zip}
   local status=0
 
-  if [ ! -d "$PETITCOMPILER_DATA_DIRECTORY/$directory" ]; then
-    pushd "$PETITCOMPILER_DATA_DIRECTORY"
+  if [ ! -d "$where/$directory" ]; then
+    pushd "$where"
       wget -O "$file" "$url"
       set +e
       unzip -o "$file"