diff options
Diffstat (limited to 'scripts/contrib')
| -rwxr-xr-x | scripts/contrib/build-perf-test-wrapper.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh index 2fb4b1119a..ef2a46e3d8 100755 --- a/scripts/contrib/build-perf-test-wrapper.sh +++ b/scripts/contrib/build-perf-test-wrapper.sh | |||
| @@ -25,6 +25,8 @@ Usage: $script [-h] [-c COMMITISH] [-C GIT_REPO] | |||
| 25 | 25 | ||
| 26 | Optional arguments: | 26 | Optional arguments: |
| 27 | -h show this help and exit. | 27 | -h show this help and exit. |
| 28 | -a ARCHIVE_DIR archive results tarball here, give an empty string to | ||
| 29 | disable tarball archiving | ||
| 28 | -c COMMITISH test (checkout) this commit | 30 | -c COMMITISH test (checkout) this commit |
| 29 | -C GIT_REPO commit results into Git | 31 | -C GIT_REPO commit results into Git |
| 30 | EOF | 32 | EOF |
| @@ -32,13 +34,16 @@ EOF | |||
| 32 | 34 | ||
| 33 | 35 | ||
| 34 | # Parse command line arguments | 36 | # Parse command line arguments |
| 37 | archive_dir=~/perf-results/archives | ||
| 35 | commitish="" | 38 | commitish="" |
| 36 | results_repo="" | 39 | results_repo="" |
| 37 | while getopts "hc:C:" opt; do | 40 | while getopts "ha:c:C:" opt; do |
| 38 | case $opt in | 41 | case $opt in |
| 39 | h) usage | 42 | h) usage |
| 40 | exit 0 | 43 | exit 0 |
| 41 | ;; | 44 | ;; |
| 45 | a) archive_dir=`realpath "$OPTARG"` | ||
| 46 | ;; | ||
| 42 | c) commitish=$OPTARG | 47 | c) commitish=$OPTARG |
| 43 | ;; | 48 | ;; |
| 44 | C) results_repo=`realpath "$OPTARG"` | 49 | C) results_repo=`realpath "$OPTARG"` |
| @@ -112,13 +117,14 @@ echo -ne "\n" | |||
| 112 | 117 | ||
| 113 | cat "$globalres_log" | 118 | cat "$globalres_log" |
| 114 | 119 | ||
| 115 | echo -ne "\n\n-----------------\n" | 120 | if [ -n "$archive_dir" ]; then |
| 116 | echo "Archiving results dir..." | 121 | echo -ne "\n\n-----------------\n" |
| 117 | archive_dir=~/perf-results/archives | 122 | echo "Archiving results in $archive_dir" |
| 118 | mkdir -p "$archive_dir" | 123 | mkdir -p "$archive_dir" |
| 119 | results_basename=`basename "$results_dir"` | 124 | results_basename=`basename "$results_dir"` |
| 120 | results_dirname=`dirname "$results_dir"` | 125 | results_dirname=`dirname "$results_dir"` |
| 121 | tar -czf "$archive_dir/`uname -n`-${results_basename}.tar.gz" -C "$results_dirname" "$results_basename" | 126 | tar -czf "$archive_dir/`uname -n`-${results_basename}.tar.gz" -C "$results_dirname" "$results_basename" |
| 127 | fi | ||
| 122 | 128 | ||
| 123 | rm -rf "$build_dir" | 129 | rm -rf "$build_dir" |
| 124 | rm -rf "$results_dir" | 130 | rm -rf "$results_dir" |
