Skip to content
Merged
Changes from 2 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
17 changes: 12 additions & 5 deletions scripts/distribution/build_and_upload_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ if [[ -n $(git diff HEAD..origin/$local_branch) ]]; then
exit 1
fi

set -e
set -euxo pipefail

SCRIPT_DIRECTORY=$(dirname -- "$(realpath -- "$0")")
CHRONON_ROOT_DIR=$(dirname "$SCRIPT_DIRECTORY")
CHRONON_ROOT_DIR=$(echo "$SCRIPT_DIRECTORY" | awk -F 'chronon' '{print $1 "chronon"}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alt here would be - CHRONON_ROOT_DIR=$(dirname "$(dirname "$SCRIPT_DIRECTORY")")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did it with awk though because wanted to make the script safe against another PR that moves this script haha


echo "Working in $CHRONON_ROOT_DIR"
cd $CHRONON_ROOT_DIR
Expand All @@ -114,8 +114,11 @@ fi
thrift --gen py -out api/py/ api/thrift/common.thrift
thrift --gen py -out api/py/ api/thrift/api.thrift
thrift --gen py -out api/py/ api/thrift/observability.thrift
VERSION=$(cat version.sbt | cut -d " " -f3 | tr -d '"') pip wheel api/py
EXPECTED_ZIPLINE_WHEEL="zipline_ai-0.1.0.dev0-py3-none-any.whl"

WHEEL_VERSION="0.1.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded for now until we do semantic releases


VERSION=$WHEEL_VERSION pip wheel api/py
EXPECTED_ZIPLINE_WHEEL="zipline_ai-0.1.0-py3-none-any.whl"
if [ ! -f "$EXPECTED_ZIPLINE_WHEEL" ]; then
echo "$EXPECTED_ZIPLINE_WHEEL not found"
exit 1
Expand Down Expand Up @@ -229,6 +232,11 @@ function upload_to_aws() {
}


if [ "$BUILD_AWS" = false ] && [ "$BUILD_GCP" = false ]; then
echo "Please select an upload option (--all, --gcp, --aws). Exiting"
exit 1
fi

if [ "$BUILD_AWS" = true ]; then
if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
Expand All @@ -246,6 +254,5 @@ if [ "$BUILD_GCP" = true ]; then
upload_to_gcp "${GCP_CUSTOMER_IDS[@]}"
fi


# Cleanup wheel stuff
rm ./*.whl