Skip to content

Commit ae1d286

Browse files
author
Guillaume Marchand
committed
version 25-11-2024
1 parent 99d48ca commit ae1d286

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+8416
-195
lines changed

Taskfile.yml

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
# SPDX-License-Identifier: Apache-2.0
1+
version: "3"
2+
33
dotenv:
44
- .env
55
- "{{.ENV}}/.env."
66
- "{{.HOME}}/.env"
7+
78
includes:
89
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
1413
dist:
1514
dir: ./
1615
optional: true
@@ -23,8 +22,49 @@ includes:
2322
dir: ./
2423
optional: true
2524
taskfile: ./tests
25+
2626
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+
2766
env:
67+
desc: Set up environment variables
2868
cmds:
2969
- rm -f .env || true
3070
- echo 'S3_BUCKET={{.S3_BUCKET}}' >> .env
@@ -34,60 +74,18 @@ tasks:
3474
- echo 'API_URL={{.API_URL}}' >> .env
3575
- echo 'API_ID={{.API_ID}}' >> .env
3676
- echo 'LAMBDA_METRICS_ARN={{.LAMBDA_METRICS_ARN}}' >> .env
37-
desc: env. variables for scripts
38-
status:
39-
- test -f .env
4077
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
5882
AWS_DEFAULT_REGION:
5983
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

Comments
 (0)