Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions ci/ci-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,25 @@ function tag {
return 0
}

function upload {
BUCKET="readonlyrest-data"
function upload_to_ror_data_bucket {
LOCAL_FILE="$1"
S3_PATH="$2"

BUCKET="readonlyrest-data"
# shellcheck disable=SC2154
"$CI_DIR"/s3-uploader.sh "$aws_access_key_id" "$aws_secret_access_key" "$BUCKET@eu-west-1" "$LOCAL_FILE" "$S3_PATH"
}

function upload_to_ror_data_xdelta_bucket {
LOCAL_FILE="$1"
S3_PATH=$(echo "$2" | sed 's:/*$::')
FILE_NAME=$(basename $LOCAL_FILE)

BUCKET="readonlyrest-data-xdelta"
DELTA_GLIDER_VERSION="main-012662c"

docker run --rm -e AWS_ACCESS_KEY_ID=$aws_access_key_id -e AWS_SECRET_ACCESS_KEY=$aws_secret_access_key \
-v $LOCAL_FILE:/tmp/$FILE_NAME:ro \
beshultd/deltaglider:$DELTA_GLIDER_VERSION \
cp /tmp/$FILE_NAME s3://$BUCKET/${S3_PATH}/${FILE_NAME}
}
3 changes: 2 additions & 1 deletion ci/upload-files-to-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ for ((i = 1; i < $#; i++)); do
FILE="${!i}"

echo "Uploading $FILE to $DEST ..."
upload "$FILE" "$DEST"
upload_to_ror_data_bucket "$FILE" "$DEST"
upload_to_ror_data_xdelta_bucket "$FILE" "$DEST"
done

echo "DONE"
8 changes: 6 additions & 2 deletions ci/upload-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ INT_TEST_REPORT=$(find . | grep report | grep integration | grep index.html)

if [ ! -z "$UNIT_TEST_REPORT" ]; then
echo "found unit test report UNIT_TEST_REPORT"
upload $UNIT_TEST_REPORT "test_reports/$(date +%Y-%m-%d_%H.%M)$ROR_TASK-unit.html"
S3_PATH="test_reports/$(date +%Y-%m-%d_%H.%M)$ROR_TASK-unit.html"
upload_to_ror_data_bucket $UNIT_TEST_REPORT $S3_PATH
upload_to_ror_data_xdelta_bucket $UNIT_TEST_REPORT $S3_PATH
fi


if [ ! -z "$INT_TEST_REPORT" ]; then
echo "found integration test report $INT_TEST_REPORT"
upload $INT_TEST_REPORT "test_reports/$(date +%Y-%m-%d_%H.%M)_$ROR_TASK-integration.html"
S3_PATH="test_reports/$(date +%Y-%m-%d_%H.%M)_$ROR_TASK-integration.html"
upload_to_ror_data_bucket $INT_TEST_REPORT $S3_PATH
upload_to_ror_data_xdelta_bucket $INT_TEST_REPORT $S3_PATH
fi

Loading