| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Used by Jenkins in post step to upload results from ./run-tests.sh |
| 4 | |
| 5 | if [[ $# -lt 4 ]] |
| 6 | then |
| 7 | echo "usage: upload-system-test-results <kafka|muckrake> branch repo test_path [ducktape_args]" |
| 8 | exit -1 |
| 9 | fi |
| 10 | |
| 11 | if [[ -z $WORKSPACE ]]; then |
| 12 | echo "This should be run by Jenkins only" |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | set -e |
| 17 | |
| 18 | . jenkins-common/resources/scripts/extract-iam-credential.sh |
| 19 | |
| 20 | set -x |
| 21 | |
| 22 | PROJECT=$1 |
| 23 | BRANCH=$2 |
| 24 | REPO=$3 |
| 25 | TEST_PATH=$4 |
| 26 | DUCKTAPE_ARGS=${DUCKTAPE_ARGS:-$5} # Existing caller might be setting it via env... |
| 27 | DIRECTORY=$WORKSPACE/results |
| 28 | BUILD_URL=$JOB_URL |
| 29 | |
| 30 | subdir=$(ls -tr $DIRECTORY | tail -1) |
| 31 | |
| 32 | bucket=$(python $WORKSPACE/jenkins-common/scripts/system-tests/test-result-storage/get_upload_location.py \ |
| 33 | --project $PROJECT --branch $BRANCH) |
| 34 | bash -x $WORKSPACE/jenkins-common/scripts/system-tests/test-result-storage/s3-upload.sh \ |
| 35 | --bucket $bucket --directory $DIRECTORY |
| 36 | echo Uploaded to S3 bucket: $bucket |