1
- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- # SPDX-License-Identifier: Apache-2.0
1
+ version : " 3 "
2
+
3
3
dotenv :
4
4
- .env
5
5
- " {{.ENV}}/.env."
6
6
- " {{.HOME}}/.env"
7
+
7
8
includes :
8
9
app :
9
- dir : ./application
10
- taskfile : ./application
11
- cdk :
12
- dir : ./
13
- taskfile : ./cdk
10
+ taskfile : ./src/Taskfile.yml
11
+ dir : ./src
12
+ cdk : ./infrastructure/Taskfile.yml
14
13
dist :
15
14
dir : ./
16
15
optional : true
@@ -23,8 +22,49 @@ includes:
23
22
dir : ./
24
23
optional : true
25
24
taskfile : ./tests
25
+
26
26
tasks :
27
+ default :
28
+ cmds :
29
+ - task : help
30
+
31
+ help :
32
+ desc : Display available tasks
33
+ cmds :
34
+ - task --list-all
35
+
36
+ setup :
37
+ desc : Set up the development environment
38
+ cmds :
39
+ - rm -rf .venv || true
40
+ - task : setup:venv
41
+ - task : setup:install
42
+
43
+ setup:venv :
44
+ desc : Create a new virtual environment
45
+ cmds :
46
+ -
47
+ - python3 -m venv .venv
48
+
49
+ setup:install :
50
+ desc : Install project dependencies
51
+ cmds :
52
+ - .venv/bin/python3 -m pip install --upgrade --quiet pip
53
+ - .venv/bin/pip install --quiet -r requirements.txt
54
+ - .venv/bin/pip install --quiet -r src/requirements.txt
55
+ - .venv/bin/pip install --quiet -r tests/requirements.txt
56
+
57
+ setup:update :
58
+ desc : upgrade python packages in python virtual env
59
+ cmds :
60
+ - .venv/bin/python3 -m pip install --upgrade --quiet pip
61
+ - .venv/bin/pip install --upgrade --quiet -r requirements.txt
62
+ - .venv/bin/pip install --upgrade --quiet -r src/requirements.txt
63
+ - .venv/bin/pip install --upgrade --quiet -r tests/requirements.txt
64
+ - .venv/bin/pip list
65
+
27
66
env :
67
+ desc : Set up environment variables
28
68
cmds :
29
69
- rm -f .env || true
30
70
- echo 'S3_BUCKET={{.S3_BUCKET}}' >> .env
@@ -34,60 +74,18 @@ tasks:
34
74
- echo 'API_URL={{.API_URL}}' >> .env
35
75
- echo 'API_ID={{.API_ID}}' >> .env
36
76
- echo 'LAMBDA_METRICS_ARN={{.LAMBDA_METRICS_ARN}}' >> .env
37
- desc : env. variables for scripts
38
- status :
39
- - test -f .env
40
77
vars :
41
- API_ID :
42
- sh :
43
- aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack
44
- --query 'Stacks[0].Outputs[?ExportName==`ffmpeg-batch-api-id`].OutputValue'
45
- --output text || true
46
- LAMBDA_METRICS_ARN :
47
- sh :
48
- aws cloudformation describe-stacks --stack-name batch-ffmpeg-metrics-stack
49
- --query 'Stacks[0].Outputs[?ExportName==`batch-ffmpeg-lambda-metrics-arn`].OutputValue'
50
- --output text || true
51
- API_URL :
52
- sh :
53
- aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack
54
- --query 'Stacks[0].Outputs[?ExportName==`ffmpeg-batch-api`].OutputValue'
55
- --output text || true
56
- AWS_ACCOUNT_ID :
57
- sh : aws sts get-caller-identity --query "Account" --output text || true
78
+ S3_BUCKET :
79
+ sh : aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack --query 'Stacks[0].Outputs[?OutputKey==`DataBucketName`].OutputValue' --output text || true
80
+ IMAGE_REPO_NAME :
81
+ sh : aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack --query 'Stacks[0].Outputs[?OutputKey==`ECRRepositoryName`].OutputValue' --output text || true
58
82
AWS_DEFAULT_REGION :
59
83
sh : aws configure get region || true
60
- IMAGE_REPO_NAME :
61
- sh :
62
- aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack
63
- --query 'Stacks[0].Outputs[?OutputKey==`EcrRegistry`].OutputValue' --output
64
- text || true
65
- S3_BUCKET :
66
- sh :
67
- aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack
68
- --query 'Stacks[0].Outputs[?OutputKey==`S3bucket`].OutputValue' --output
69
- text || true
70
- venv :
71
- cmds :
72
- - rm -rf .venv/ || true
73
- - python3 -m venv .venv
74
- - .venv/bin/python3 -m pip install --upgrade --quiet pip
75
- - .venv/bin/pip install --quiet -r requirements.txt
76
- - .venv/bin/pip install --quiet -r application/requirements.txt
77
- - .venv/bin/pip install --quiet -r tests/requirements.txt
78
- desc : Create local python virtual env
79
- generates :
80
- - .venv/bin/activate
81
- sources :
82
- - requirements.txt
83
- venv:upgrade :
84
- cmds :
85
- - .venv/bin/python3 -m pip install --upgrade --quiet pip
86
- - .venv/bin/pip install --upgrade --quiet -r requirements.txt
87
- - .venv/bin/pip install --upgrade --quiet -r application/requirements.txt
88
- - .venv/bin/pip install --upgrade --quiet -r tests/requirements.txt
89
- - .venv/bin/pip list
90
- desc : upgrade python packages in python virtual env
91
- vars :
92
- IMAGE_REPO_NAME : batch-ffmpeg
93
- version : " 3"
84
+ AWS_ACCOUNT_ID :
85
+ sh : aws sts get-caller-identity --query "Account" --output text || true
86
+ API_URL :
87
+ sh : aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack --query 'Stacks[0].Outputs[?OutputKey==`ApiUrl`].OutputValue' --output text || true
88
+ API_ID :
89
+ sh : aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack --query 'Stacks[0].Outputs[?OutputKey==`ApiId`].OutputValue' --output text || true
90
+ LAMBDA_METRICS_ARN :
91
+ sh : aws cloudformation describe-stacks --stack-name batch-ffmpeg-metrics-stack --query 'Stacks[0].Outputs[?OutputKey==`MetricsExportLambdaArn`].OutputValue' --output text || true
0 commit comments