Use shared directory for test data on Jenkins
...in order to save bandwidth and disk space.
--- 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"