forked from inspectIT/inspectit-ocelot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes inspectIT#80 - Upload test reports after failures on TravisCI
- Loading branch information
Showing
2 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Create test report archive and upload it to transfer.sh | ||
|
||
echo "Packing and uploading test-reports" | ||
|
||
ARCHIVE_FILE_NAME="inspectit-oce-test-reports-$TRAVIS_JOB_NUMBER.zip" | ||
ARCHIVE_FILE="$TRAVIS_BUILD_DIR/$ARCHIVE_FILE_NAME" | ||
|
||
DIRECTORY="$TRAVIS_BUILD_DIR/inspectit-oce-agent/build/reports/tests/" | ||
if [ -d "$DIRECTORY" ]; then | ||
echo "Packing test-reports of agent project.." | ||
cd "$DIRECTORY" | ||
mv ./* agent | ||
zip -q -r "$ARCHIVE_FILE" . | ||
fi | ||
|
||
DIRECTORY="$TRAVIS_BUILD_DIR/inspectit-oce-core/build/reports/tests/" | ||
if [ -d "$DIRECTORY" ]; then | ||
echo "Packing test-reports of core project.." | ||
cd "$DIRECTORY" | ||
mv ./* core | ||
zip -q -r "$ARCHIVE_FILE" . | ||
fi | ||
|
||
if [ -f "$ARCHIVE_FILE" ]; then | ||
echo "Found test-report archive. Uploading it to 'transfer.sh'." | ||
|
||
TRANSFER_SH_URL=$(curl -s --upload-file "$ARCHIVE_FILE" "https://transfer.sh/$ARCHIVE_FILE_NAME") | ||
|
||
echo "Archive containing test-reports can be found and downloaded at the following URL:" | ||
echo "" | ||
echo " $TRANSFER_SH_URL" | ||
echo "" | ||
else | ||
echo "Archive containing test-reports does not exist. Nothing to upload." | ||
fi |