-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAWS.yaml
More file actions
25 lines (22 loc) · 953 Bytes
/
AWS.yaml
File metadata and controls
25 lines (22 loc) · 953 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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
run: once
tasks:
s3-upload-file:
desc: uploads the given file to the specified S3 bucket
dir: "{{.USER_WORKING_DIR}}"
requires: { vars: [FILE_PATH, S3_BUCKET_NAME, S3_OBJECT_KEY] }
preconditions:
- sh: "[ -f {{.FILE_PATH}} ]"
msg: "file {{.FILE_PATH}} does not exist"
cmd: aws s3 cp {{.FILE_PATH}} s3://{{.S3_BUCKET_NAME}}/{{.S3_OBJECT_KEY}}
s3-download-file:
desc: downloads the given object from the specified S3 bucket
dir: "{{.USER_WORKING_DIR}}"
requires: { vars: [FILE_PATH, S3_BUCKET_NAME, S3_OBJECT_KEY] }
cmd: aws s3 cp s3://{{.S3_BUCKET_NAME}}/{{.S3_OBJECT_KEY}} {{.FILE_PATH}}
s3-list-files:
desc: list all objects in the specified S3 bucket
dir: "{{.USER_WORKING_DIR}}"
requires: { vars: [S3_BUCKET_NAME] }
cmd: aws s3 ls s3://{{.S3_BUCKET_NAME}} --recursive --human-readable --summarize