mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-18 02:05:13 +00:00
Merge pull request #1294 from gaul/test/profile
Allow overriding test credentials with a profile
This commit is contained in:
commit
eb58460175
@ -8,9 +8,10 @@
|
|||||||
# environment variables:
|
# environment variables:
|
||||||
#
|
#
|
||||||
# S3FS_CREDENTIALS_FILE=keyfile s3fs format key file
|
# S3FS_CREDENTIALS_FILE=keyfile s3fs format key file
|
||||||
|
# S3FS_PROFILE=name s3fs profile to use (overrides key file)
|
||||||
# TEST_BUCKET_1=bucketname Name of bucket to use
|
# TEST_BUCKET_1=bucketname Name of bucket to use
|
||||||
# S3PROXY_BINARY="" Specify empty string to skip S3Proxy start
|
# S3PROXY_BINARY="" Specify empty string to skip S3Proxy start
|
||||||
# S3_URL="https://s3.amazonaws.com" Specify Amazon AWS as the S3 provider
|
# S3_URL="https://s3.amazonaws.com" Specify Amazon AWS as the S3 provider
|
||||||
#
|
#
|
||||||
# Example of running against Amazon S3 using a bucket named "bucket:
|
# Example of running against Amazon S3 using a bucket named "bucket:
|
||||||
#
|
#
|
||||||
@ -62,8 +63,10 @@ then
|
|||||||
fi
|
fi
|
||||||
chmod 600 "$S3FS_CREDENTIALS_FILE"
|
chmod 600 "$S3FS_CREDENTIALS_FILE"
|
||||||
|
|
||||||
export AWS_ACCESS_KEY_ID=$(cut -d: -f1 ${S3FS_CREDENTIALS_FILE})
|
if [ -z "${S3FS_PROFILE}" ]; then
|
||||||
export AWS_SECRET_ACCESS_KEY=$(cut -d: -f2 ${S3FS_CREDENTIALS_FILE})
|
export AWS_ACCESS_KEY_ID=$(cut -d: -f1 ${S3FS_CREDENTIALS_FILE})
|
||||||
|
export AWS_SECRET_ACCESS_KEY=$(cut -d: -f2 ${S3FS_CREDENTIALS_FILE})
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d $TEST_BUCKET_MOUNT_POINT_1 ]
|
if [ ! -d $TEST_BUCKET_MOUNT_POINT_1 ]
|
||||||
then
|
then
|
||||||
@ -143,6 +146,8 @@ function start_s3fs {
|
|||||||
# Public bucket if PUBLIC is set
|
# Public bucket if PUBLIC is set
|
||||||
if [ -n "${PUBLIC}" ]; then
|
if [ -n "${PUBLIC}" ]; then
|
||||||
AUTH_OPT="-o public_bucket=1"
|
AUTH_OPT="-o public_bucket=1"
|
||||||
|
elif [ -n "${S3FS_PROFILE}" ]; then
|
||||||
|
AUTH_OPT="-o profile=${S3FS_PROFILE}"
|
||||||
else
|
else
|
||||||
AUTH_OPT="-o passwd_file=${S3FS_CREDENTIALS_FILE}"
|
AUTH_OPT="-o passwd_file=${S3FS_CREDENTIALS_FILE}"
|
||||||
fi
|
fi
|
||||||
|
@ -264,5 +264,9 @@ function get_disk_avail_size() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function aws_cli() {
|
function aws_cli() {
|
||||||
aws $* --endpoint-url "${S3_URL}" --no-verify-ssl
|
FLAGS=""
|
||||||
|
if [ -n "${S3FS_PROFILE}" ]; then
|
||||||
|
FLAGS="--profile ${S3FS_PROFILE}"
|
||||||
|
fi
|
||||||
|
aws $* --endpoint-url "${S3_URL}" --no-verify-ssl $FLAGS
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user