-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTaskfile.yml
91 lines (82 loc) · 3.01 KB
/
Taskfile.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
version: "3"
dotenv:
- .env
- "{{.ENV}}/.env."
- "{{.HOME}}/.env"
includes:
app:
taskfile: ./src/Taskfile.yml
dir: ./src
cdk: ./infrastructure/Taskfile.yml
dist:
dir: ./
optional: true
taskfile: ./deployment
doc:
dir: ./doc
optional: true
taskfile: ./doc
test:
dir: ./
optional: true
taskfile: ./tests
tasks:
default:
cmds:
- task: help
help:
desc: Display available tasks
cmds:
- task --list-all
setup:
desc: Set up the development environment
cmds:
- rm -rf .venv || true
- task: setup:venv
- task: setup:install
setup:venv:
desc: Create a new virtual environment
cmds:
-
- python3 -m venv .venv
setup:install:
desc: Install project dependencies
cmds:
- .venv/bin/python3 -m pip install --upgrade --quiet pip
- .venv/bin/pip install --quiet -r requirements.txt
- .venv/bin/pip install --quiet -r src/requirements.txt
- .venv/bin/pip install --quiet -r tests/requirements.txt || true
setup:update:
desc: upgrade python packages in python virtual env
cmds:
- .venv/bin/python3 -m pip install --upgrade --quiet pip
- .venv/bin/pip install --upgrade --quiet -r requirements.txt
- .venv/bin/pip install --upgrade --quiet -r src/requirements.txt
- .venv/bin/pip install --upgrade --quiet -r tests/requirements.txt
- .venv/bin/pip list
env:
desc: Set up environment variables
cmds:
- rm -f .env || true
- echo 'S3_BUCKET={{.S3_BUCKET}}' >> .env
- echo 'IMAGE_REPO_NAME={{.IMAGE_REPO_NAME}}' >> .env
- echo 'AWS_DEFAULT_REGION={{.AWS_DEFAULT_REGION}}' >> .env
- echo 'AWS_ACCOUNT_ID={{.AWS_ACCOUNT_ID}}' >> .env
- echo 'API_URL={{.API_URL}}' >> .env
- echo 'API_ID={{.API_ID}}' >> .env
- echo 'LAMBDA_METRICS_ARN={{.LAMBDA_METRICS_ARN}}' >> .env
vars:
S3_BUCKET:
sh: aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack --query 'Stacks[0].Outputs[?OutputKey==`DataBucketName`].OutputValue' --output text || true
IMAGE_REPO_NAME:
sh: aws cloudformation describe-stacks --stack-name batch-ffmpeg-storage-stack --query 'Stacks[0].Outputs[?OutputKey==`ECRRepositoryName`].OutputValue' --output text || true
AWS_DEFAULT_REGION:
sh: aws configure get region || true
AWS_ACCOUNT_ID:
sh: aws sts get-caller-identity --query "Account" --output text || true
API_URL:
sh: aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack --query 'Stacks[0].Outputs[?OutputKey==`ApiUrl`].OutputValue' --output text || true
API_ID:
sh: aws cloudformation describe-stacks --stack-name batch-ffmpeg-api-stack --query 'Stacks[0].Outputs[?OutputKey==`ApiId`].OutputValue' --output text || true
LAMBDA_METRICS_ARN:
sh: aws cloudformation describe-stacks --stack-name batch-ffmpeg-metrics-stack --query 'Stacks[0].Outputs[?OutputKey==`MetricsExportLambdaArn`].OutputValue' --output text || true