From 484c88efd585ec865ff189a2d12afeca9800fc9e Mon Sep 17 00:00:00 2001 From: ihiverlet <94982379+ihiverlet@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:09:22 +0100 Subject: [PATCH] set s3 credentials for duckdb (#151) * set s3 credentials for duckdb * duckdb init script use eof --- scripts/onyxia-init.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/onyxia-init.sh b/scripts/onyxia-init.sh index cc4f0923..683dadcc 100644 --- a/scripts/onyxia-init.sh +++ b/scripts/onyxia-init.sh @@ -168,6 +168,16 @@ if [[ "$DARK_MODE" == "true" ]]; then fi fi +if [[ -n $AWS_S3_ENDPOINT ]] && command -v duckdb ; then +cat < ${HOME}/.duckdbrc +-- Duck head prompt +.prompt '🦆 ' +-- Set s3 context +CALL load_aws_credentials(); +SET s3_endpoint='$AWS_S3_ENDPOINT'; +EOF +fi + if [[ -e "$HOME/work" ]]; then if [[ $(id -u) = 0 ]]; then echo "cd $HOME/work" >> /etc/profile