-
Notifications
You must be signed in to change notification settings - Fork 2
/
binaries_upload.sh
executable file
·46 lines (42 loc) · 1.49 KB
/
binaries_upload.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
#!/bin/bash
# Upload binaries to S3 bucket so they can be used by capillaries-deploy
# Assuming the bucket $1 (s3://capillaries-release/latest) is publicly accessible for read (no write, and no directory listing)
# {
# "Version": "2012-10-17",
# "Statement": [
# {
# "Effect": "Allow",
# "Principal": {
# "AWS": "arn:aws:iam::<root_user>:user/capillaries-testuser"
# },
# "Action": "s3:ListBucket",
# "Resource": "arn:aws:s3:::capillaries-release"
# },
# {
# "Effect": "Allow",
# "Principal": {
# "AWS": "arn:aws:iam::<root_user>:user/capillaries-testuser"
# },
# "Action": [
# "s3:DeleteObject",
# "s3:GetObject",
# "s3:PutObject"
# ],
# "Resource": "arn:aws:s3:::capillaries-release/*"
# },
# {
# "Effect": "Allow",
# "Principal": "*",
# "Action": "s3:GetObject",
# "Resource": "arn:aws:s3:::capillaries-release/*"
# }
# ]
# }
if [ "$1" = "" ]; then
echo No destination S3 url specified, not uploading the binaries
echo To upload, specify s3 url, for example: s3://capillaries-release/latest
echo Also, make sure AWS credentials are in place : AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_DEFAULT_REGION
exit 0
fi
echo "Copying in files to "$1
aws s3 cp ./build/ $1/ --recursive --include "*"