forked from zdurham/s3-upload-github-action
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·40 lines (29 loc) · 757 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·40 lines (29 loc) · 757 Bytes
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
#!/bin/sh
set -e
# if [ -z "$S3_BUCKET" ]; then
# echo "S3_BUCKET is not set. Quitting."
# exit 1
# fi
# if [ -z "$AWS_ACCESS_KEY_ID" ]; then
# echo "AWS_ACCESS_KEY_ID is not set. Quitting."
# exit 1
# fi
# if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
# echo "AWS_SECRET_ACCESS_KEY is not set. Quitting."
# exit 1
# fi
# if [-z "$FILE"]; then
# echo "FILE is not set. Quitting"
# exit 1
# fi
# if [ -z "$AWS_REGION"]; then
# AWS_REGION="us-east-1"
# fi
mkdir -p ~/.aws
touch ~/.aws/credentials
echo "[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" > ~/.aws/credentials
aws --version
aws s3 cp ${FILE} s3://${S3_BUCKET}/${S3_KEY} --region ${AWS_REGION} --recursive
rm -rf ~/.aws