-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from Maxxen/dev
More move returns, update extension upload script
- Loading branch information
Showing
3 changed files
with
40 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# Usage: ./extension-upload.sh <name> <extension_version> <duckdb_version> <architecture> <s3_bucket> <copy_to_latest> | ||
# Extension upload script | ||
|
||
# Usage: ./extension-upload-oote.sh <name> <extension_version> <duckdb_version> <architecture> <s3_bucket> <copy_to_latest> <copy_to_versioned> | ||
# <name> : Name of the extension | ||
# <extension_version> : Version (commit / version tag) of the extension | ||
# <duckdb_version> : Version (commit / version tag) of DuckDB | ||
# <architecture> : Architecture target of the extension binary | ||
# <s3_bucket> : S3 bucket to upload to | ||
# <copy_to_latest> : Set this as the latest version ("true" / "false", default: "false") | ||
# <copy_to_latest> : Set this as a versioned version that will prevent its deletion | ||
|
||
set -e | ||
|
||
ext="build/release/extension/$1/$1.duckdb_extension" | ||
ext="/tmp/extension/$1.duckdb_extension" | ||
|
||
script_dir="$(dirname "$(readlink -f "$0")")" | ||
|
||
# Abort if AWS key is not set | ||
if [ -z "$AWS_ACCESS_KEY_ID" ]; then | ||
echo "No AWS key found, skipping.." | ||
exit 0 | ||
fi | ||
|
||
# (Optionally) Sign binary | ||
if [ "$DUCKDB_EXTENSION_SIGNING_PK" != "" ]; then | ||
echo "$DUCKDB_EXTENSION_SIGNING_PK" > private.pem | ||
$script_dir/../duckdb/scripts/compute-extension-hash.sh $ext > $ext.hash | ||
openssl pkeyutl -sign -in $ext.hash -inkey private.pem -pkeyopt digest:sha256 -out $ext.sign | ||
cat $ext.sign >> $ext | ||
fi | ||
|
||
set -e | ||
|
||
# compress extension binary | ||
gzip < $ext > "$1.duckdb_extension.gz" | ||
gzip < "${ext}" > "$ext.gz" | ||
|
||
# upload compressed extension binary to S3 | ||
aws s3 cp $1.duckdb_extension.gz s3://$5/$1/$2/$3/$4/$1.duckdb_extension.gz --acl public-read | ||
# upload versioned version | ||
if [[ $7 = 'true' ]]; then | ||
aws s3 cp $ext.gz s3://$5/$1/$2/$3/$4/$1.duckdb_extension.gz --acl public-read | ||
fi | ||
|
||
if [ $6 = 'true'] | ||
then | ||
aws s3 cp $1.duckdb_extension.gz s3://$5/$1/latest/$3/$4/$1.duckdb_extension.gz --acl public-read | ||
# upload to latest version | ||
if [[ $6 = 'true' ]]; then | ||
aws s3 cp $ext.gz s3://$5/$3/$4/$1.duckdb_extension.gz --acl public-read | ||
fi | ||
# also uplo | ||
|
||
if [ "$DUCKDB_EXTENSION_SIGNING_PK" != "" ]; then | ||
rm private.pem | ||
fi |
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