-
Notifications
You must be signed in to change notification settings - Fork 67
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 #4 from freegroup/freegroup-patch-1
fixing #3
- Loading branch information
Showing
4 changed files
with
53 additions
and
13 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
set -o errexit | ||
set -o errtrace | ||
IFS=$'\n\t' | ||
|
||
export S3_ACL=${S3_ACL:-private} | ||
|
||
mkdir -p ${MNT_POINT} | ||
|
||
if [ "$IAM_ROLE" == "none" ]; then | ||
export AWSACCESSKEYID=${AWSACCESSKEYID:-$AWS_KEY} | ||
export AWSSECRETACCESSKEY=${AWSSECRETACCESSKEY:-$AWS_SECRET_KEY} | ||
|
||
echo "${AWS_KEY}:${AWS_SECRET_KEY}" > /etc/passwd-s3fs | ||
chmod 0400 /etc/passwd-s3fs | ||
|
||
echo 'IAM_ROLE is not set - mounting S3 with credentials from ENV' | ||
/usr/bin/s3fs ${S3_BUCKET} ${MNT_POINT} -d -d -f -o endpoint=${S3_REGION},allow_other,retries=5 | ||
echo 'started...' | ||
else | ||
echo 'IAM_ROLE is set - using it to mount S3' | ||
/usr/bin/s3fs ${S3_BUCKET} ${MNT_POINT} -d -d -f -o endpoint=${S3_REGION},iam_role=${IAM_ROLE},allow_other,retries=5 | ||
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