-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.R
40 lines (33 loc) · 877 Bytes
/
upload.R
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
library(aws.s3)
args = commandArgs(trailingOnly=TRUE)
if (length(args)==0) {
stop("At least one argument must be supplied, the key", call.=FALSE)
}
print('uploading to AWS')
key = args[1]
secret = args[2]
region=args[3]
bucket = args[4]
put_object(
file = file.path(".", "CovidDashboard.html"),
object = "CovidDashboard.html",
bucket = bucket,
multipart = TRUE,
region = region,
key = key,
secret = secret,
headers=c('content-type' = 'text/html')
)
put_object(
file = file.path(".", "kingCountyThreeWeeks.csv"),
object = "kingCountyThreeWeeks.csv",
bucket = bucket,
multipart = TRUE,
region = region,
key = key,
secret = secret
)
# get_bucket(bucket = bucket,key = key, secret = secret ,region = region)
# head_object(object='CovidDashboard.html', bucket = bucket,key = key, secret = secret ,region = region)
# )
print('uploaded')