-
Notifications
You must be signed in to change notification settings - Fork 2
/
s3.sh
47 lines (32 loc) · 860 Bytes
/
s3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# IAM role that allows access to S3 bucket
S3_ROLE="s3-imaging-platform-role"
# Name of S3 bucket to be mounted
BUCKET_ID="imaging-platform"
#-----------------------------
# s3fs
# https://github.com/s3fs-fuse/s3fs-fuse
#-----------------------------
sudo apt-get install -y \
automake \
autotools-dev \
g++ \
git \
libcurl4-gnutls-dev \
libfuse-dev \
libssl-dev \
libxml2-dev \
make \
pkg-config
mkdir -p ~/work/software/archives
cd ~/work/software/archives
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure --prefix=/usr --with-openssl
make
sudo make install
cd ~
mkdir ~/bucket
echo "${BUCKET_ID} /home/ubuntu/bucket fuse.s3fs _netdev,allow_other,iam_role=${S3_ROLE},uid=1000,gid=1000,umask=0022 0 0" | sudo tee --append /etc/fstab
sudo mount -a