2023-03-18 00:29:56 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-03-18 00:35:03 +00:00
|
|
|
s3_upload () {
|
|
|
|
aws s3 cp "$1" "$2" \
|
2023-03-22 11:12:23 +00:00
|
|
|
--recursive
|
2023-03-18 00:35:03 +00:00
|
|
|
}
|
|
|
|
|
2023-03-18 00:29:56 +00:00
|
|
|
upload_allure_results () {
|
|
|
|
if [[ $INCLUDE_ALLURE_RESULTS != "true" ]]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
SOURCE="$ALLURE_RESULTS_DIR"
|
2023-03-18 00:35:03 +00:00
|
|
|
DESTINATION="$S3_BUCKET/artifacts/$GITHUB_RUN_ID/$ARTIFACT_NAME/allure-results"
|
2023-03-18 00:29:56 +00:00
|
|
|
|
2023-03-22 11:12:23 +00:00
|
|
|
s3_upload "$SOURCE" "$DESTINATION"
|
2023-03-18 00:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
upload_allure_report () {
|
|
|
|
SOURCE="$ALLURE_REPORT_DIR"
|
2023-03-18 00:35:03 +00:00
|
|
|
DESTINATION="$S3_BUCKET/artifacts/$GITHUB_RUN_ID/$ARTIFACT_NAME/allure-report"
|
2023-03-18 00:29:56 +00:00
|
|
|
|
2023-03-22 11:12:23 +00:00
|
|
|
s3_upload "$SOURCE" "$DESTINATION"
|
2023-03-18 00:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
upload_allure_results
|
|
|
|
upload_allure_report
|
|
|
|
|
|
|
|
EXIT_CODE=$(echo $?)
|
|
|
|
exit $EXIT_CODE
|